feat(file-manager): sync the working directory between the shell and the panel #36

Closed
BlackAngelTV wants to merge 0 commits from feat/cwd-sync into main
pull from: feat/cwd-sync
Owner

Fixes #20

Ce que fait cette branche

Le panneau et le shell gardaient chacun leur répertoire : chaque navigation dans le panneau demandait un cd à la main. La synchronisation passe par des fichiers d'un répertoire de session exporté par kitty, pas par une commande tapée dans le terminal : rien ne s'ajoute à l'historique et une ligne à moitié saisie n'est jamais soumise.

  • feat(file-manager) : nouvelle option sync_cwd, qui tient les deux répertoires en phase dans les deux sens. Le shell applique le répertoire choisi dans le panneau depuis son prompt hook, avec builtin cd.
  • feat(file-manager) : la synchronisation est active par défaut, sync_cwd no rend aux deux leur indépendance d'avant. La demande n'est écrite qu'une fois le shell a publié son répertoire, parce que ce fichier prouve que son hook lira la demande : sans intégration shell, le cd est tapé dans le terminal au lieu d'être perdu.
  • feat(file-manager) : naviguer dans le panneau déplace aussi le shell, comme un cd ; quitter sans valider (Échap) retire une demande pas encore lue, donc le shell reste là où il était.

Les trois hooks (bash, zsh, fish) sont adaptés, et l'option est documentée dans docs/kittens/file-manager.rst, le glossaire et le changelog.

Vérifications

  • bash -n shell-integration/bash/kitty.bash et zsh -n shell-integration/zsh/kitty-integration : OK
  • python3 -m py_compile kittens/file_manager/main.py kitty/tabs.py kitty/child.py : OK
  • go vet / go test ./kittens/file_manager/ : non exécutables ici, voir la limite ci-dessous

Limite

cli_generated.go et conf_generated.go sont générés à la compilation et ne sont pas versionnés. Dans l'environnement de développement, PYTHONPATH=. python3 gen/go_code.py échoue sur une AssertionError dans kitty/conf/generate.py (échec identique sur main), donc go vet et go test cassent sur conf.Sync_cwd undefined : c'est du code généré périmé, pas une erreur de la branche. À valider par un build complet (python3 setup.py) avant fusion. Fish n'est pas installé ici, son hook n'a pas été exécuté.

Fixes #20 ## Ce que fait cette branche Le panneau et le shell gardaient chacun leur répertoire : chaque navigation dans le panneau demandait un `cd` à la main. La synchronisation passe par des fichiers d'un répertoire de session exporté par kitty, pas par une commande tapée dans le terminal : rien ne s'ajoute à l'historique et une ligne à moitié saisie n'est jamais soumise. - `feat(file-manager)` : nouvelle option `sync_cwd`, qui tient les deux répertoires en phase dans les deux sens. Le shell applique le répertoire choisi dans le panneau depuis son prompt hook, avec `builtin cd`. - `feat(file-manager)` : la synchronisation est active par défaut, `sync_cwd no` rend aux deux leur indépendance d'avant. La demande n'est écrite qu'une fois le shell a publié son répertoire, parce que ce fichier prouve que son hook lira la demande : sans intégration shell, le `cd` est tapé dans le terminal au lieu d'être perdu. - `feat(file-manager)` : naviguer dans le panneau déplace aussi le shell, comme un `cd` ; quitter sans valider (Échap) retire une demande pas encore lue, donc le shell reste là où il était. Les trois hooks (bash, zsh, fish) sont adaptés, et l'option est documentée dans `docs/kittens/file-manager.rst`, le glossaire et le changelog. ## Vérifications - `bash -n shell-integration/bash/kitty.bash` et `zsh -n shell-integration/zsh/kitty-integration` : OK - `python3 -m py_compile kittens/file_manager/main.py kitty/tabs.py kitty/child.py` : OK - `go vet` / `go test ./kittens/file_manager/` : non exécutables ici, voir la limite ci-dessous ## Limite `cli_generated.go` et `conf_generated.go` sont générés à la compilation et ne sont pas versionnés. Dans l'environnement de développement, `PYTHONPATH=. python3 gen/go_code.py` échoue sur une `AssertionError` dans `kitty/conf/generate.py` (échec identique sur `main`), donc `go vet` et `go test` cassent sur `conf.Sync_cwd undefined` : c'est du code généré périmé, pas une erreur de la branche. À valider par un build complet (`python3 setup.py`) avant fusion. Fish n'est pas installé ici, son hook n'a pas été exécuté.
BlackAngelTV added 3 commits 2026-11-11 08:54:28 +01:00
The panel and the shell each kept their own directory. The new sync_cwd option
keeps them in step both ways, through files in a session directory exported by
kitty rather than by typing a command into the terminal: the shell applies the
directory chosen in the panel from its prompt hook with builtin cd, so nothing
lands in the history and a half typed multi-line command is not submitted.
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.
Opening a directory in the panel now hands it to the shell, so walking the tree
reads like cd and the two stay on the same directory. The request is still read
at the shell's next prompt, and quitting without validating withdraws a request
the shell has not read yet, so Esc keeps leaving the shell where it was.
BlackAngelTV added the Kind/Feature label 2026-11-11 10:08:28 +01:00
BlackAngelTV added this to the FWS - KITTY project 2026-11-11 10:08:33 +01:00
BlackAngelTV moved this to In progress in FWS - KITTY on 2026-11-11 10:08:47 +01:00
angi was assigned by BlackAngelTV 2026-11-11 11:17:30 +01:00
nocode was assigned by BlackAngelTV 2026-11-11 11:17:30 +01:00
BlackAngelTV changed title from Feat/cwd sync to feat(file-manager): sync the working directory between the shell and the panel 2026-11-11 11:18:15 +01:00
BlackAngelTV moved this to DONE in FWS - KITTY on 2026-11-11 20:19:18 +01:00
BlackAngelTV moved this to In progress in FWS - KITTY on 2026-11-11 20:20:15 +01:00
BlackAngelTV closed this pull request 2026-11-12 07:32:29 +01:00
BlackAngelTV deleted branch feat/cwd-sync 2026-11-12 07:32:33 +01:00
BlackAngelTV moved this to DONE in FWS - KITTY on 2026-11-12 12:21:45 +01:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
No labels Kind/Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: FWS/FWS-Kitty#36