mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-24 05:40:15 +00:00
feat: add GTK keybinds (matching the idiomatic Linux convention used by Firefox, GNOME Terminal, and VSCode) for move_tab (#12458)
> Re-submitting #11857, which was auto-closed pre-vouch. I'm now in the vouched list. ## Summary Adds default keybinds for `move_tab` on GTK/Linux, matching the idiomatic Linux convention used by Firefox, GNOME Terminal, and VSCode: - **`Ctrl+Shift+PageUp`** → `move_tab:-1` (move tab left) - **`Ctrl+Shift+PageDown`** → `move_tab:1` (move tab right) To free these keys, `jump_to_prompt` is reassigned to `Ctrl+Shift+Arrow Up/Down`, which: - Mirrors the macOS default (`Cmd+Shift+Arrow Up/Down`) - Is currently unbound on GTK - Maintains directional consistency (up = previous, down = next) The new `move_tab` bindings use `putFlags` with `performable: true` to match the pattern used by other tab actions (`previous_tab`, `next_tab`). Closes #4998 ## Changes - `src/config/Config.zig`: Reassign `jump_to_prompt` from `Ctrl+Shift+PageUp/PageDown` to `Ctrl+Shift+Arrow Up/Down` (GTK only) - `src/config/Config.zig`: Add `move_tab` default keybinds as `Ctrl+Shift+PageUp/PageDown` (GTK only) ## Test plan - [ ] Build on Linux/GTK: `zig build` - [ ] Verify `Ctrl+Shift+PageUp` moves current tab left - [ ] Verify `Ctrl+Shift+PageDown` moves current tab right - [ ] Verify `Ctrl+Shift+Arrow Up` jumps to previous prompt - [ ] Verify `Ctrl+Shift+Arrow Down` jumps to next prompt - [ ] Verify `Ctrl+PageUp/PageDown` still switches tabs (unchanged) - [ ] Verify macOS keybinds are unaffected
This commit is contained in:
@@ -6766,15 +6766,29 @@ pub const Keybinds = struct {
|
||||
// Semantic prompts
|
||||
try self.set.put(
|
||||
alloc,
|
||||
.{ .key = .{ .physical = .page_up }, .mods = .{ .shift = true, .ctrl = true } },
|
||||
.{ .key = .{ .physical = .arrow_up }, .mods = .{ .shift = true, .ctrl = true } },
|
||||
.{ .jump_to_prompt = -1 },
|
||||
);
|
||||
try self.set.put(
|
||||
alloc,
|
||||
.{ .key = .{ .physical = .page_down }, .mods = .{ .shift = true, .ctrl = true } },
|
||||
.{ .key = .{ .physical = .arrow_down }, .mods = .{ .shift = true, .ctrl = true } },
|
||||
.{ .jump_to_prompt = 1 },
|
||||
);
|
||||
|
||||
// Move tab
|
||||
try self.set.putFlags(
|
||||
alloc,
|
||||
.{ .key = .{ .physical = .page_up }, .mods = .{ .shift = true, .ctrl = true } },
|
||||
.{ .move_tab = -1 },
|
||||
.{ .performable = true },
|
||||
);
|
||||
try self.set.putFlags(
|
||||
alloc,
|
||||
.{ .key = .{ .physical = .page_down }, .mods = .{ .shift = true, .ctrl = true } },
|
||||
.{ .move_tab = 1 },
|
||||
.{ .performable = true },
|
||||
);
|
||||
|
||||
// Search
|
||||
try self.set.putFlags(
|
||||
alloc,
|
||||
|
||||
Reference in New Issue
Block a user