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