@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 03:37 UTC

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