Add better and configurable shortcuts.

This commit is contained in:
Greyson Parrelli
2026-08-15 00:00:06 -04:00
parent 043b994a15
commit a742b51d3b
6 changed files with 987 additions and 136 deletions
+83 -20
View File
@@ -403,8 +403,12 @@ in principle, but a terminal grid is small.
right-click menu, picked out of the full emoji set with keyword search. See
[Tab settings](#tab-settings)
- **Zooming a pane** to fill its tab and back, from the header button or
`Ctrl+Shift+Z`. Nothing closes and nothing moves — hidden panes keep running
and the split comes back exactly as it was. See [Zoom](#zoom)
`Ctrl+Shift+Z` / `Ctrl+Shift+F`. Nothing closes and nothing moves — hidden
panes keep running and the split comes back exactly as it was. See [Zoom](#zoom)
- **Moving around a split from the keyboard**: `Ctrl+Shift+H/J/K/L` moves focus
to the pane in that direction, `Alt+Shift+J/K` steps through tabs. Every chord
in the app can be rebound in `settings.json`. See
[Rebinding a shortcut](#rebinding-a-shortcut)
- **Light and dark schemes**, following the desktop by default and pinnable
from the settings page, applying to open tabs immediately — terminal palette
included. See [Theme](#theme)
@@ -416,21 +420,26 @@ in principle, but a terminal grid is small.
### Shortcuts
| | |
|---|---|
| `Ctrl+Shift+T` | new tab |
| `Ctrl+Shift+E` | new terminal in the current tab |
| `Ctrl+Shift+B` | new web view in the current tab |
| `Ctrl+Shift+W` | close the focused pane (closes the tab with its last one) |
| `Ctrl+Shift+←/→/↑/↓` | move the focused pane within its view |
| `Ctrl+Shift+V` | paste into a terminal (bracketed-paste aware, refuses unsafe pastes) |
| `Ctrl+Shift+C` | copy the terminal selection |
| `Ctrl+Shift+R` | rename the current tab (empty name = follow the terminal) |
| `Ctrl+Shift+Z` | zoom the focused pane to fill the tab, and back |
| `Ctrl+F` | find in the focused web page (web panes only — see [Find in page](#find-in-page)) |
| `Ctrl+,` | settings |
| `Ctrl+PageUp/PageDown` | previous / next tab |
| `Alt+1`..`Alt+8` | jump to tab N, `Alt+9` jumps to the last |
| | | |
|---|---|---|
| `Ctrl+Shift+T` | new tab | `new_tab` |
| `Ctrl+Shift+E` | new terminal in the current tab | `new_terminal` |
| `Ctrl+Shift+B` | new web view in the current tab | `new_web` |
| `Ctrl+Shift+W` | close the focused pane (closes the tab with its last one) | `close_pane` |
| `Ctrl+Shift+H/J/K/L` | move focus to the pane left / below / above / right | `focus_pane_left` and friends |
| `Ctrl+Shift+←/→/↑/↓` | move the focused pane within its view | `move_pane_left` and friends |
| `Ctrl+Shift+V` | paste into a terminal (bracketed-paste aware, refuses unsafe pastes) | `paste` |
| `Ctrl+Shift+C` | copy the terminal selection | `copy` |
| `Ctrl+Shift+R` | rename the current tab (empty name = follow the terminal) | `rename_tab` |
| `Ctrl+Shift+Z`, `Ctrl+Shift+F` | zoom the focused pane to fill the tab, and back | `toggle_zoom` |
| `Ctrl+F` | find in the focused web page (web panes only — see [Find in page](#find-in-page)) | `find` |
| `Ctrl+,` | settings | `open_settings` |
| `Ctrl+PageUp/PageDown`, `Alt+Shift+K/J` | previous / next tab | `prev_tab`, `next_tab` |
| `Alt+1`..`Alt+8` | jump to tab N | `select_tab_1`.. |
| `Alt+9` | jump to the last tab | `select_last_tab` |
The third column is the action's name in `settings.json`, which is where any of
these can be changed — see [Rebinding a shortcut](#rebinding-a-shortcut).
Dragging a pane by its header does the same thing as the arrow shortcuts: the
edge you drop against decides both the order and the view's orientation. The
@@ -440,6 +449,60 @@ competes with the content's own mouse handling.
Both add-pane shortcuts are also buttons in every pane header, which is how you
open a web view without remembering the chord.
### Moving around a split
`Ctrl+Shift+H/J/K/L` moves focus between panes; the arrow keys on the same
modifiers move the *pane* instead. Which pane is "the one to the left" is
answered by where the panes are on screen rather than by walking the split tree,
so it means what it looks like — a tree walk would have to choose between a
sibling and a cousin, and on screen there is no such distinction.
Nothing happens at the edges of a view, and the key is swallowed rather than
passed on: the chord was bound for navigating, and handing it to the shell in
the last pane of a split would send a control code nobody asked for. Zoom is the
other case where focus stays put — the other panes are not on screen, and the
arrangement is exactly what zoom is hiding.
### Rebinding a shortcut
Every chord in the table above is a default, not a fixture. A `shortcuts` object
in `settings.json` names the ones to change:
```json
{
"version": 1,
"shortcuts": {
"focus_pane_left": "ctrl+alt+h",
"toggle_zoom": ["ctrl+shift+z", "super+f"],
"copy": []
}
}
```
A value is one chord or a list of them, and an entry **replaces** that action's
defaults rather than adding to them — which is what lets a chord be moved from
one action to another without the old owner still answering to it. An empty list
switches a shortcut off entirely and hands the key back to whatever is running
in the terminal. An action the file doesn't mention keeps the chords this build
ships with, so a later version can retune the defaults and still reach anyone
who never touched them.
A chord is modifiers and a key, `+`-separated, in any order and in any case:
`ctrl`, `alt`, `shift`, `super` (`control`, `option`, `meta`, `win` and `cmd`
also read), then a key named the way you would say it — `h`, `7`, `left`,
`page_up`, `f5`, `escape`, `space`, `comma`, `bracket_left`.
**Every shortcut needs `Ctrl`, `Alt` or `Super`.** A bare key, or one with only
`Shift`, belongs to whatever is running in the terminal — claiming `F1` for the
window would take it from every program that has ever drawn a help bar. A chord
that doesn't parse, or an action name this build doesn't have, costs that one
binding and is logged; the rest of the file is read normally.
The file is rewritten whole every time a setting changes, so what you write here
comes back out of the settings page unharmed — in the app's own canonical
spelling, which is why `Shift + CTRL + H` is read once and written back as
`ctrl+shift+h`.
## The mouse in a terminal
A terminal's pointer has two possible owners, and which one has it depends on
@@ -468,9 +531,9 @@ anyway.
## Zoom
A split that was the right shape for watching two things at once is usually the
wrong shape for actually working in one of them. `Ctrl+Shift+Z`, or the
fullscreen button in a pane's header, gives that pane the whole tab; the same
again puts the split back.
wrong shape for actually working in one of them. `Ctrl+Shift+Z` or
`Ctrl+Shift+F`, or the fullscreen button in a pane's header, gives that pane the
whole tab; the same again puts the split back.
This is not the window manager's fullscreen. The window keeps its decorations,
the sidebar stays put, and only the tab's own content area is involved.