fix(ghostty/zellij): translate mac super and ctrl shortcuts to alt sequences for zellij

This commit is contained in:
Noah Masur
2026-08-27 11:26:37 -06:00
parent 239b56c1b1
commit 44f2ca803e
3 changed files with 27 additions and 11 deletions
@@ -36,15 +36,15 @@ in
quit-after-last-window-closed = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin true;
fullscreen = if pkgs.stdenv.hostPlatform.isDarwin then true else false;
keybind = [
"super+t=unbind" # Pass super-t to underlying tool (e.g. zellij tabs)
"super+shift+]=unbind"
"super+shift+[=unbind"
"ctrl+tab=unbind"
"ctrl+shift+tab=unbind"
"ctrl+tab=text:\\x1b[9;5u"
"ctrl+shift+tab=text:\\x1b[9;6u"
"super+k=unbind"
"super+shift+e=unbind"
# Translate Mac Super & Ctrl combinations into Alt (ESC prefix) sequences
# so Zellij receives them without needing Kitty keyboard protocol
"super+t=text:\\x1bt"
"super+shift+]=text:\\x1b}"
"super+shift+[=text:\\x1b{"
"ctrl+tab=text:\\x1b}"
"ctrl+shift+tab=text:\\x1b{"
"super+k=text:\\x1bK"
"super+shift+e=text:\\x1bE"
];
};
themes."gruvbox" = {
@@ -295,9 +295,15 @@ in
"bind \"Super Shift ]\"" = {
GoToNextTab = { };
};
"bind \"Alt Shift ]\"" = {
GoToNextTab = { };
};
"bind \"Super Shift [\"" = {
GoToPreviousTab = { };
};
"bind \"Alt Shift [\"" = {
GoToPreviousTab = { };
};
"bind \"Ctrl Tab\"" = {
GoToNextTab = { };
};
@@ -307,7 +313,7 @@ in
"bind \"Super t\"" = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
NewTab = { };
};
"bind \"Alt t\"" = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
"bind \"Alt t\"" = {
NewTab = { };
};
"bind \"Super k\"" = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
@@ -315,13 +321,18 @@ in
_args = [ "scroll" ];
};
};
"bind \"Alt Shift k\"" = {
SwitchToMode = {
_args = [ "scroll" ];
};
};
"bind \"Super Shift e\"" = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
EditScrollback = { };
SwitchToMode = {
_args = [ "locked" ];
};
};
"bind \"Alt Shift e\"" = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
"bind \"Alt Shift e\"" = {
EditScrollback = { };
SwitchToMode = {
_args = [ "locked" ];