Skip to content

Latest commit

 

History

History
283 lines (221 loc) · 14.8 KB

keybindings.md

File metadata and controls

283 lines (221 loc) · 14.8 KB

Keybindings

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

Search on that page matches action names, command IDs, conditions and shortcuts, such as mod+k or ⌘K. To see all bindings of one action, choose Show bindings for this action in the menu of its row.

A button, menu item or command palette row that a shortcut can also run shows its shortcut, in its tooltip or next to it. A menu item without a shortcut shows a faint dash. Right-click such a control, or press Shift+F10 or the context menu key on it, and choose Keybindings…. A menu stays open behind it. This also works on an item that is disabled now, and on rows of the keyboard cheat sheet. The page opens with that action filtered and a new binding for it ready to record.

Composer controls

mod+shift+d starts dictation in the focused editor, or the composer, and finishes it on the next press; Esc discards the recording. Change the chord under Composer: Start or Finish Dictation, and the hold or toggle behavior in Settings → Voice. See Voice input.

In Settings → Chat → Send shortcut, choose whether Enter sends, requires mod+Enter for multiline prompts, or always requires mod+Enter. Shift+Enter inserts a new line. This applies to the web and desktop composer at desktop widths.

Follow-up behavior chooses Queue or Steer while the agent runs. Use mod+Enter to do the opposite for one message, even when the send shortcut requires a modifier. mod+Alt+Enter sends, keeps that thread running in the background, and opens a fresh new-thread composer. In a new thread, mod+Enter does the same. Change these shortcuts in Settings → Keybindings under Composer: Opposite Queue or Steer Action, Composer: Start in Background, or Composer: Send and Start New Thread. These bindings take priority over the send shortcut. Click the send button to use the configured follow-up behavior.

When a thread has queued messages, mod+Shift+Enter sends the first one as a steer while a turn is running, or as a new turn when the thread is stopped. Change it under Queue: Send First Queued Message in Keybindings.

Use mod+shift+m to choose a model and mod+shift+h to choose a host. To step a new thread to the next machine instead of opening the menu, bind Composer: Cycle Host in Keybindings. It has no default shortcut. Use mod+shift+e for effort, mod+shift+a for permissions, mod+shift+x for the workspace, and mod+shift+g for the Git branch. The workspace menu includes the current checkout, a new worktree, and the previous worktree when available. Use mod+shift+l to reuse the previous worktree directly.

To change effort one step without opening the picker, bind Composer: Increase Effort and Composer: Decrease Effort in Keybindings. Both are unbound by default. Increase wraps from the highest level to the lowest, and decrease wraps from the lowest level to the highest.

In the model picker, press Left in an empty search field or Shift+Tab to reach the provider list. Use Up/Down to move and Enter to choose. Right returns to model search. Right at the end of the search moves to the highlighted model's effort 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 search. These provider shortcuts can also be changed in Settings.

These shortcuts run inside the focused web or desktop client. mod uses Command on macOS and Ctrl on Windows and Linux, including GNOME, KDE Plasma, Niri, and Hyprland. If a custom desktop shortcut takes the same keys, choose another binding in Settings.

Focus levels

Turn on Settings → Keybindings → Keyboard focus levels to move focus between the composer, the timeline, the right panel and the sidebar with the keyboard. It is off by default.

  • Escape moves one level up: from the composer to the timeline, then to the sidebar. An open menu, dialog, find bar or sidebar selection takes Escape first. On the Pull Requests page, Escape still goes back.
  • In the desktop app, mod+alt+left and mod+alt+right move between the sidebar, the chat and the right panel.
  • Outside a text field, typing a letter in the chat goes to the composer. In the sidebar, digits switch tabs, and other letters do nothing.
  • A key that moves focus outlines the area it moves to. Turn this off in Settings → Keybindings → Focus highlight.

In the sidebar, Up and Down move between threads, and Enter opens one and focuses its timeline. Up from the first thread reaches the sidebar tabs. Left and Right, or 1 to 9, switch tabs. mod+f focuses sidebar search, and mod+alt+f does so from anywhere. mod+shift+f opens the sidebar Filter menu. mod+alt+1 to mod+alt+4 focus the sidebar, the timeline, the composer and the right panel. In the timeline, p pins the focused message and l copies its link.

In the timeline, Up and Down move a cursor between messages. Right goes one level deeper: blocks such as paragraphs and list items, then sentences or code lines. A sentence also splits after a colon that a space follows. Left goes back up. Up and Down stay at the depth that Right and Left chose. At the end of a list they continue with the next item one level up, then go back down: 1.1, 1.2, 1.3, 2, 2.1. After you select text or click in the timeline with the mouse, the next arrow key starts from there, and Enter cites exactly the selected text. Shift with Up or Down extends the selection within one list. Enter cites the selection with a note, and alt+enter cites it without one. Only assistant text can be cited. mod+down jumps to the latest message. PageUp and PageDown still scroll. Inside a message, Up and Down also stop on each link, section header and button, after the text that holds it. Enter clicks it. Right opens a closed section, and Left closes an open one. Escape goes back to the text, and Escape on a link that has focus returns to the cursor.

These keys work with the setting off too:

  • mod+. stops the running turn, outside terminals.
  • Thread keys act on the selected sidebar thread, or on the open thread elsewhere. mod+backspace archives (sidebar and timeline only), mod+alt+s snoozes or wakes, mod+alt+r renames, and mod+shift+u marks unread.
  • While an approval waits and no text field or terminal has focus, mod+y approves, mod+shift+y always allows for the session, and mod+alt+y declines.
  • In the desktop app, ctrl+tab and ctrl+shift+tab switch right panel tabs.
  • In a browser, mod+, opens settings.
  • mod+/ lists every shortcut, with the keys for the area you are in first. It also works with the setting off.

Copy pull request references

With a PR open in the right panel or on the Pull requests page, use mod+shift+c to copy its URL and mod+shift+k to copy its number with a # prefix. Both shortcuts can be changed in Settings. Search for “Copy Link or Thread” or “Copy Number”. They copy the selected PR and leave terminal input alone. Without a PR, mod+shift+c copies the thread itself, which pastes into a composer as a thread chip.

Find in a diff

Click into a diff in the Diff panel or a pull request's Code tab, then press mod+f to search every file in it, including folded files and unchanged lines hidden between changes. Enter and Shift+Enter move between matches, and a match in a folded file opens it. Escape closes the search. This shortcut is not configurable. A very large uncommitted diff loads its files as you scroll, and find only searches the files loaded so far.

iPad

With a hardware keyboard, use Cmd+1 through Cmd+9 to open the first nine displayed threads. The shortcuts follow the current list filters and order. Cmd+K opens the command palette to search commands, projects, and threads. Use the arrow keys and Return to choose a result, or Cmd+1 through Cmd+9 to choose directly. Escape or Cmd+K closes the palette. Start a search with > to show only actions.

In a new thread, Cmd+Shift+H moves the draft to the next machine.

In the composer, Return sends and Shift+Return inserts a new line. While a turn is running, Cmd+Return sends with the other follow-up action. To make Return insert a new line instead, change the Return key behavior in Settings → Keyboard; Cmd+Return then sends.

Android

With a hardware keyboard, the composer handles Return as on iPad, with Ctrl in place of Cmd. The on-screen keyboard's Return always inserts a new line.

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, rightPanelOpen, modelPickerOpen, usagePageOpen, composerFocus, draftThreadRoute, turnRunning, editableFocus, timelineFocus, sidebarFocus, rightPanelFocus, approvalPending, compactBeforeSendShown, isWeb, and isDesktop. compactBeforeSendShown is true while the composer shows the Compact or Keep toggle. rightPanelOpen applies only to rightPanel.new and is true while the right panel is open; the default mod+t uses it to open the panel's new-tab menu. draftThreadRoute is true on a draft thread, including a restored draft, until it is first sent. editableFocus is true while a text field, the composer, or another editor has the keyboard. isWeb is true in a browser tab. isDesktop is true in the desktop app. Unknown keys evaluate to false.

mod+1 through mod+9 jump to the first nine threads, and to models while the model picker is open. The thread jumps do not run while the model picker is open. Those defaults use isDesktop so they do not steal the browser's tab-switch shortcuts. Remove that condition in Settings if you want the same jumps in a browser.

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

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

Find in the current thread

chat.find searches conversation messages and proposed plans in the active thread. Entering a query searches the entire thread, including older messages. Thread search requires server support; update an older server to enable it. Select Retry if a search fails. It defaults to mod+f outside terminals and previews. Press Enter or Shift+Enter to move between matches, and Escape to close find.

Find on a browser page

preview.find (mod+f while a browser has focus) searches the open page in the desktop app. It is also in the browser's ⋮ menu and the command palette. A page that handles mod+f itself, such as a code editor, keeps its own find. Use the ⋮ menu to reach the browser's find there. Streamed browser tabs and T3 Code in a web browser do not support it.

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

thread.stop (mod+. by default, outside terminals) interrupts the running turn in the focused thread.

thread.regenerateTitle generates a new title for the focused thread, like Regenerate title in the thread menu. It has no default shortcut.

thread.undo (mod+z by default) reverses the actions shown in the notice at the bottom of the sidebar, such as unpin, settle, snooze, archive, or discarding a draft. Consecutive actions of the same kind undo together. The notice remains available for five seconds after the latest action. Right after an action, the shortcut works even in a text field such as the composer. Once you type or press another key, the field gets its own undo back. Terminals always keep their native shortcut.

navigation.back (mod+[ by default) and navigation.forward (mod+]) move through the pages you have visited, like a browser's back and forward buttons.

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. chat.newWithoutProject (mod+alt+n) starts a thread without a project. chat.newTerminal (mod+alt+t) and chat.newTerminalLocal (mod+alt+shift+n) are the same two commands for a terminal thread: the first may ask for a project, the second starts in the focused project. They do nothing until a server turns on Terminal threads.

Reserved shortcuts

In the desktop app, mod+w closes the focused terminal or the active right-panel tab. When nothing remains to close, it does nothing; it never 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.

mod+shift+t reopens the last closed tab across the app, including files, diffs, pull requests, browsers, and devices, in the order you closed them. A browser opens in a fresh session without its old page history. Incognito tabs can reopen until you reload or quit the app. This shortcut does not undo deleted work. Browsers also use it to reopen browser tabs; choose another binding in Settings if the browser takes it first.

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.