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