Skip to content

Latest commit

 

History

History
111 lines (80 loc) · 5.11 KB

File metadata and controls

111 lines (80 loc) · 5.11 KB

Keybindings

Customize shortcuts in Settings → Keybindings on web and desktop. That page also lists the command IDs and defaults available in your version.

Edit the configuration file

Keybindings live on the environment's machine, in ~/.t3/userdata/keybindings.json by default. You can edit this file directly. It is a JSON array of rules:

[
  { "key": "mod+g", "command": "terminal.toggle" },
  { "key": "mod+shift+g", "command": "terminal.new", "when": "terminalFocus" }
]

T3 Code creates the file with its defaults and adds new defaults on later startups. New defaults do not replace commands you customized. If a new default overlaps one of your shortcuts, rule order decides which runs. Invalid rules are ignored; if the file cannot be parsed, T3 Code uses defaults.

Rule shape

Each rule requires a key shortcut and a command ID. An optional when expression restricts when it runs.

Project scripts use script.{id}.run, such as script.test.run.

Key syntax

Join modifiers and a key with +, such as mod+shift+d or ctrl+l. mod means Command on macOS and Control elsewhere. Other modifiers are cmd / meta, ctrl / control, alt / option, and shift.

When conditions

Available context keys are terminalFocus, terminalOpen, previewFocus, previewOpen, and modelPickerOpen. Unknown keys evaluate to false.

Combine keys with ! for not, && for and, || for or, and parentheses:

{ "key": "mod+j", "command": "terminal.toggle", "when": "terminalOpen && !terminalFocus" }

rightPanel.toggleMaximized maximizes or restores the open right panel. It has no default shortcut, so add one in SettingsKeybindings if you want to use it.

thread.settle settles the active thread or restores it when it is already settled. Its default shortcut is mod+shift+s, and it does not run while the terminal has focus.

The command palette searches active thread titles, projects, branches, user messages, and final agent responses across connected environments. Message matches show one labeled excerpt while keeping the thread's project, branch, and machine context visible. Message search begins after two characters and uses SQLite's ASCII case-insensitive matching.

The full command list and the current defaults are shown in SettingsKeybindings, which always matches the build you are running. Use that rather than a copied list.

With focus anywhere in the chat view, press Escape to retract the message you just sent and move it back into the composer for editing immediately, while the agent stops in the background. This works from the instant you send until the agent shows assistant text, a tool call, a command, or another activity for that turn. Agent thinking does not close this short window. Retracting a thread's first message returns you to the draft page. The shortcut is built into the chat view and is not configurable. Retraction supports text and image messages; messages with other file attachments stay in the conversation.

Note that chat.new and chat.newLocal both create a thread through the same path. A new thread inherits the project you were in, along with model and mode selections. Branch, worktree, and environment mode always come from your configured defaults, not from the thread you were looking at. To keep a worktree, use the explicit "new thread in this worktree" action in the branch toolbar. The only difference between the two commands: with the current sidebar and more than one project, chat.new opens a project chooser first.

Background submission from a new thread is the exception. mod+enter starts that thread and opens another new thread with the same workspace mode and base branch. New worktree remains selected, but the new thread does not reuse the worktree created for the thread that just started.

Precedence

The last rule whose key and condition both match wins, even if it belongs to a different command. Put a more specific rule after a general one when they share a shortcut.

Commands with special behavior

chat.new may ask you to choose a project when there is more than one. chat.newLocal skips that chooser. Both use your new-thread defaults.

Reserved shortcuts

In the desktop app, mod+w closes the focused terminal or the active right-panel tab. When nothing remains to close, it closes the window. In a browser, mod+w closes the browser tab; rebind rightPanel.close and terminal.close to an available shortcut such as alt+w.

Many defaults include !terminalFocus so they do not intercept terminal input. Keep that condition when remapping them if you want the same behavior.

Desktop quit shortcut

Use Cmd+Q on macOS or Ctrl+Q on Windows and Linux. In the default Hold mode, hold for 1.2 seconds or press twice within 500 milliseconds. Holding requires keyboard repeat; if repeat is disabled, use two presses or the application menu.

Change Settings → General → Confirmations → Quit shortcut to Direct for a single press or Double press for two presses only. Choosing Quit from the application menu always quits immediately.