Open History to see the last commit
1# Keybindings
2
3Customize shortcuts in **Settings → Keybindings** on web and desktop. That page
4also lists the command IDs and defaults available in your version.
5
6## Composer controls
7
8Use `mod+shift+m` to choose a model and `mod+shift+h` to choose a host.
9Use `mod+shift+e` for effort, `mod+shift+a` for access mode, `mod+shift+x` for the
10workspace, and `mod+shift+g` for the Git branch. The workspace menu includes the
11current checkout, a new worktree, and the previous worktree when available.
12Use `mod+shift+l` to reuse the previous worktree directly.
13
14In the model picker, press Left in an empty search field or Shift+Tab to reach
15the provider list. Use Up/Down to move and Enter to choose. Right returns to
16model search. `mod+shift+up` and `mod+shift+down` switch providers directly and clear the
17search. These provider shortcuts can also be changed in Settings.
18
19These shortcuts run inside the focused web or desktop client. `mod` uses Command
20on macOS and Ctrl on Windows and Linux, including GNOME, KDE Plasma, Niri, and
21Hyprland. If a custom desktop shortcut takes the same keys, choose another binding
22in Settings.
23
24## Copy pull request references
25
26With a PR open in the right panel or on the Pull Requests page, use `mod+shift+c`
27to copy its URL and `mod+shift+k` to copy its number with a `#` prefix.
28Both shortcuts can be changed in Settings. Search for “Copy Link or Thread ID”
29or “Copy Number”. They copy the selected PR and leave terminal input alone.
30
31## iPad
32
33With a hardware keyboard, use `Cmd+1` through `Cmd+9` to open the first nine
34displayed threads. The shortcuts follow the current list filters and order.
35`Cmd+K` opens the command palette to search commands, projects, and threads.
36Use the arrow keys and Return to choose a result, or `Cmd+1` through `Cmd+9` to
37choose directly. Escape or `Cmd+K` closes the palette. Start a search with `>`
38to show only actions.
39
40In the composer, Return sends and `Shift+Return` inserts a new line. `Cmd+Return`
41also sends. To make Return insert a new line instead, change the Return key
42behavior in Settings → Keyboard.
43
44## Edit the configuration file
45
46Keybindings live on the environment's machine, in
47`~/.t3/userdata/keybindings.json` by default. You can edit this file directly.
48It is a JSON array of rules:
49
50```json
51[
52 { "key": "mod+g", "command": "terminal.toggle" },
53 { "key": "mod+shift+g", "command": "terminal.new", "when": "terminalFocus" }
54]
55```
56
57T3 Code creates the file with its defaults and adds new defaults on later startups.
58New defaults do not replace commands you customized. If a new default overlaps one
59of your shortcuts, [rule order](#precedence) decides which runs.
60Invalid rules are ignored; if the file cannot be parsed, T3 Code uses defaults.
61
62## Rule shape
63
64Each rule requires a `key` shortcut and a `command` ID. An optional `when`
65expression restricts when it runs.
66
67Project scripts use `script.{id}.run`, such as `script.test.run`.
68
69## Key syntax
70
71Join modifiers and a key with `+`, such as `mod+shift+d` or `ctrl+l`.
72`mod` means Command on macOS and Control elsewhere. Other modifiers are
73`cmd` / `meta`, `ctrl` / `control`, `alt` / `option`, and `shift`.
74
75## When conditions
76
77Available context keys are `terminalFocus`, `terminalOpen`, `previewFocus`,
78`previewOpen`, and `modelPickerOpen`. Unknown keys evaluate to `false`.
79
80Combine keys with `!` for not, `&&` for and, `||` for or, and parentheses:
81
82```json
83{ "key": "mod+j", "command": "terminal.toggle", "when": "terminalOpen && !terminalFocus" }
84```
85
86## Precedence
87
88The last rule whose key and condition both match wins, even if it belongs to a
89different command. Put a more specific rule after a general one when they share
90a shortcut.
91
92## Commands with special behavior
93
94`thread.stop` interrupts the running turn in the focused thread. It has no default
95shortcut; assign one in **Settings → Keybindings**.
96
97`chat.new` may ask you to choose a project when there is more than one.
98`chat.newLocal` skips that chooser. Both use your
99[new-thread defaults](./thread-sidebar.md#start-a-thread).
100
101## Reserved shortcuts
102
103In the desktop app, `mod+w` closes the focused terminal or the active right-panel
104tab. When nothing remains to close, it closes the window. In a browser, `mod+w`
105closes the browser tab; rebind `rightPanel.close` and `terminal.close` to an available
106shortcut such as `alt+w`.
107
108Many defaults include `!terminalFocus` so they do not intercept terminal input.
109Keep that condition when remapping them if you want the same behavior.
110
111## Desktop quit shortcut
112
113Use `Cmd+Q` on macOS or `Ctrl+Q` on Windows and Linux. In the default **Hold** mode,
114hold for 1.2 seconds or press twice within 500 milliseconds. Holding requires
115keyboard repeat; if repeat is disabled, use two presses or the application menu.
116
117Change **Settings → General → Confirmations → Quit shortcut** to **Direct** for a
118single press or **Double press** for two presses only. Choosing **Quit** from the
119application menu always quits immediately.