From b0b08d2475d0691b54a3967ac45477b028d0c106 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 24 Aug 2026 19:52:06 -0600 Subject: [PATCH] fix(zellij): fix CWD tracking in fish for zellij tabs --- docs/CHANGELOG.md | 1 + .../modules/nmasur/presets/programs/zellij.nix | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 90531ca2..2671954f 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2026-08-16 +- Fixed Zellij new tab directory tracking by adding `__fish_update_cwd_osc` override in `presets/programs/zellij.nix`. Fish's default OSC 7 sequence includes `$hostname`, which on macOS or dynamic network environments evaluates to `Noah-MacBook-Pro.local` or a domain suffix. Zellij compares the OSC 7 hostname against its system hostname (`Noah-MacBook-Pro`), finds a mismatch, and silently ignores the CWD update, leaving new tabs stuck in a previous directory or session default. Overriding `__fish_update_cwd_osc` to send `file://` (empty hostname) ensures Zellij always updates its cached CWD on every `cd` and prompt render. - Fixed Firefox "profile cannot be loaded" error on macOS by removing `home.file."Library/Application Support/Firefox/installs.ini"`. Hardcoding an installation hash in `installs.ini` broke whenever Firefox was updated or rebuilt in the Nix store because the nix store path changed, causing Firefox to compute a new installation hash, fail to match or write to the read-only `installs.ini` symlink, and error out. Firefox on macOS uses `profiles.ini` (managed by Home Manager) and `MOZ_LEGACY_PROFILES=1` (exported by nixpkgs' launcher wrapper). ## 2026-08-03 diff --git a/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix b/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix index 5f89c69e..b8167894 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix @@ -75,6 +75,17 @@ in ${lib.getExe pkgs.zellij} action new-pane --start-suspended -- gh run watch ''; }; + __fish_update_cwd_osc = { + description = "Notify Zellij/terminal of CWD changes without hostname mismatch"; + body = # fish + '' + if test "$TERM" != "dumb" + printf \e\]7\;file://%s\a (string escape --style=url -- $PWD) + end + ''; + onVariable = "PWD"; + onEvent = "fish_prompt"; + }; }; };