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