Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ separately in [CHANGELOG-DEPS.md](CHANGELOG-DEPS.md).

## Unreleased

- **Linux desktops can open folders in Ferail.** The desktop entry handles
directory paths through `--navigate`, which now also applies to normal windows.

- **Going up to a parent folder selects the folder you came from and scrolls
it into view, whichever way you go up.** Backspace and Back already did
this; clicking a breadcrumb segment, a folder in the sidebar tree, or typing
Expand Down
8 changes: 2 additions & 6 deletions crates/ferail-gpui/resources/linux/ferail.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@
# to "ferail" (see ferail-gpui/src/lib.rs base_window_options). Rename
# this file and the taskbar icon/grouping silently breaks.
#
# No %F/%U field code on Exec yet: the binary treats a bare positional
# argument as an unknown subcommand (src/main.rs handle_cli_subcommand),
# so it cannot open a directory passed by the desktop shell. Add
# MimeType=inode/directory; and Exec=ferail %U once a path argument is
# supported.
[Desktop Entry]
Type=Application
Name=Ferail
GenericName=File Manager
Comment=Fast file manager with disk usage, previews, and dual-pane browsing
Exec=ferail
Exec=ferail --navigate %f
MimeType=inode/directory;
Icon=ferail
Terminal=false
Categories=System;FileTools;FileManager;
Expand Down
18 changes: 16 additions & 2 deletions crates/ferail-gpui/src/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ pub fn run_gui(args: screenshot::Args) {
let theme_mode = args.theme;
let settings_page = args.settings;
let initial_archive = args.archive;
let initial_directory = args
.navigate
.last()
.cloned()
.map(crate::shell::canonicalize_for_identity);

app.run(move |cx| {
// Arm the Prime Directive's debug-build tripwire: from here on,
Expand Down Expand Up @@ -467,7 +472,12 @@ pub fn run_gui(args: screenshot::Args) {
let initial_size = (width, height);
cx.spawn(async move |cx| {
cx.update(|cx| {
open_shell_window_sized(cx, Some(initial_size), initial_archive);
open_shell_window_sized(
cx,
Some(initial_size),
initial_archive,
initial_directory,
);
});
})
.detach();
Expand Down Expand Up @@ -496,7 +506,7 @@ fn settings_window_opts(width: f32, height: f32) -> WindowOptions {
/// route through this so there's one place that owns window options
/// and process-state hookup.
pub fn open_shell_window(cx: &mut App) {
open_shell_window_sized(cx, None, None);
open_shell_window_sized(cx, None, None, None);
}

#[cfg(feature = "screenshot-harness")]
Expand Down Expand Up @@ -636,6 +646,7 @@ fn open_shell_window_sized(
cx: &mut App,
size_hint: Option<(f32, f32)>,
initial_archive: Option<std::path::PathBuf>,
initial_directory: Option<std::path::PathBuf>,
) {
let (w, h) = size_hint.unwrap_or((1180.0, 760.0));
let opts = WindowOptions {
Expand All @@ -654,6 +665,9 @@ fn open_shell_window_sized(
install_dev_window_callback_cleanup(window, cx);
let process = crate::process_state::process_state(cx);
let view = cx.new(|cx| Shell::new(process, window, cx));
if let Some(directory) = initial_directory.clone() {
view.update(cx, |shell, cx| shell.navigate(directory, cx));
}
if let Some(archive) = initial_archive.clone() {
view.update(cx, |shell, cx| {
shell.open_archive_path(archive, window, cx);
Expand Down