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

+7 -6
View File
@@ -222,12 +222,13 @@ Detailed list of changes
0.50.1 [unreleased]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- The :doc:`file manager <kittens/file-manager>` can now keep its directory in
step with the shell: with :code:`sync_cwd yes`, a :code:`cd` moves the panel
into the same directory and validating a directory moves the shell at its
next prompt, for bash, zsh and fish. Nothing is typed into the terminal, so
no command lands in the history and a multi-line command being typed is left
untouched.
- The :doc:`file manager <kittens/file-manager>` now keeps its directory in
step with the shell by default: a :code:`cd` moves the panel into the same
directory and validating a directory moves the shell at its next prompt, for
bash, zsh and fish. Nothing is typed into the terminal, so no command lands
in the history and a multi-line command being typed is left untouched. Set
:code:`sync_cwd no` in :file:`file-manager.conf` to keep the two directories
independent, as before.
- :kbd:`Ctrl+Shift+E` now opens the :doc:`file manager kitten
<kittens/file-manager>` in a left dock by default, instead of requiring a
+6 -7
View File
@@ -98,15 +98,14 @@ Actions
Synchronisation avec le shell
------------------------------
Par défaut, le panneau et le shell gardent chacun leur répertoire : le panneau
part de celui du shell, mais un :code:`cd` d'un côté ne change rien de l'autre.
L'option ``sync_cwd`` les tient synchronisés dans les deux sens ::
Le panneau et le shell partagent leur répertoire courant depuis la version
0.50.1 : un :code:`cd` dans le shell amène le panneau dans le même répertoire,
et valider un répertoire dans le panneau amène le shell vers celui-ci. Pour que
chacun garde son propre répertoire, alors que le panneau part toujours de celui
du shell et n'en change plus ::
# ~/.config/kitty/file-manager.conf
sync_cwd yes
Un :code:`cd` dans le shell amène alors le panneau dans le même répertoire, et
valider un répertoire dans le panneau amène le shell vers celui-ci.
sync_cwd no
L'échange ne passe pas par le terminal. kitty exporte un répertoire de session
dans :envvar:`KITTY_CWD_SYNC_DIR` ; le shell y publie son répertoire courant et