fix(fish): fix TUI exit hang and typing latency in Zellij and Ghostty

This commit is contained in:
Noah Masur
2026-08-24 20:14:53 -06:00
parent b0b08d2475
commit 32989f1758
3 changed files with 23 additions and 6 deletions
@@ -69,9 +69,6 @@ in
set -g fish_cursor_insert line
set -g fish_cursor_visual block
set -g fish_cursor_replace_one underscore
# Fix for lagging after exiting TUIs with Zellij and Ghostty
set -a fish_features no-query-term
'';
loginShellInit = "";
shellAbbrs = {
@@ -117,10 +114,17 @@ in
dr = "docker run --rm -it";
db = "docker build . -t";
};
shellInit = "";
shellInit = ''
# Fix for lagging/hanging after exiting TUIs inside terminal multiplexers like Zellij:
# Disable fish terminal querying at startup so fish does not query DA1/termcap on return.
set -gx fish_features no-query-term
'';
};
home.sessionVariables.fish_greeting = "";
home.sessionVariables = {
fish_greeting = "";
fish_features = "no-query-term";
};
};
}
@@ -23,7 +23,7 @@ in
package = if pkgs.stdenv.isDarwin then pkgs.ghostty-bin else pkgs.ghostty;
enableFishIntegration = true;
enableFishIntegration = false; # Handled conditionally below to avoid conflicts inside Zellij/TMUX
enableBashIntegration = true;
enableZshIntegration = true;
installBatSyntax = false; # The file doesn't seem to exist in the pkg
@@ -81,5 +81,12 @@ in
};
# Conditionally enable Ghostty fish shell integration only when NOT running inside multiplexers like Zellij/TMUX
programs.fish.shellInit = ''
if set -q GHOSTTY_RESOURCES_DIR; and not set -q ZELLIJ; and not set -q TMUX
source "$GHOSTTY_RESOURCES_DIR/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish"
end
'';
};
}