feat(file-manager): sync the working directory by default

The panel and the shell now share their directory out of the box; whoever wants
the previous independence sets sync_cwd no. The request is only written once the
shell has published its directory, since that file is what proves its
integration hook will read the request: a shell without shell integration still
gets the cd typed into the terminal instead of losing the change.
This commit is contained in:
BlackAngelTV committed 2026-11-11 08:35:19 +01:00
1 parent 1b330bcf81
commit e7e4e849eb
7 files changed
+61 -16

No files matched your search

+4 -1
View File
@@ -495,7 +495,10 @@ func (h *Handler) change_shell_dir_to(path string) {
h.result_action, h.result_path = "cd", path
// With the sync on, the shell reads the request from its session file at the
// next prompt, so the handler must not also type the change into its pty.
if h.sync != nil && h.sync.publish_request(path) == nil {
// The request is only written once the shell proved it has the hook by
// publishing its directory: a shell without shell integration would
// otherwise never see it and the change would be silently lost.
if h.sync != nil && h.sync.shell_has_hook() && h.sync.publish_request(path) == nil {
h.sync_handled = true
}
h.lp.Quit(0)