Code

Terminal

Run commands in your project environment from the editor.

Your project runs in a cloud sandbox with a dev server. The Terminal gives you a shell in that sandbox, so you can run commands, read the dev server output and restart it, right from the editor.

The bottom panel on the Terminal tab, with the Dev server session and a shell session that listed the project files and the last commits.

What you can do

  • Read the live output of the dev server.
  • Open up to 4 shell sessions and run any command.
  • Search the output, copy it, or clear it.
  • Send selected output to the AI.
  • Restart the dev server, or open the preview in a new tab.
  • Change the terminal theme, font and scrollback.
  • Rename a session, and split the terminal to see two sessions side by side.
  • Drop a file from the explorer to type its path.
  • Run the code you select in the editor.
  • Open a file at the line a command prints, with one click.

Open the terminal

Press Cmd/Ctrl + J, choose Terminal in the status bar, or run Toggle Terminal from the command palette. The bottom panel opens with four tabs:

TabWhat it shows
ProblemsType errors, lint warnings and build errors. See Problems.
OutputThe logs of the branch you are on: TypeScript and Lint, each with the status of its last check (such as Passed, Could not run or Did not finish), Server logs, and Git, one line per git command run for you, with its result and time (the credentials of a remote are hidden).
Browser consoleThe console messages of your preview.
TerminalThe dev server session and your shell sessions.

Run a command

  1. Open a shell

    On the Terminal tab, choose New Terminal. Each project branch can have up to 4 shell sessions.

  2. Type the command

    For example, bun add date-fns or bun run build.

  3. Close it when done

    Choose Kill Terminal to stop the session.

The Dev server session is always there. It shows the dev server's output. When it prints errors, the terminal shows how many were found, with View in Problems.

Rename a terminal

Double-click a session's tab, press F2 on it, or right-click it and choose Rename. Type the new name and press Enter. Escape keeps the old name, and an empty name gives the session its first name back.

Split the terminal

Choose Split terminal. Two sessions show side by side, each pane with its own session tabs; on a narrow panel the panes stack. To resize them, drag the line between them, or focus it and use the arrow keys.

Cmd/Ctrl + Alt + Left or Right (Up or Down when the panes stack) moves the keyboard to the other pane. Close a pane with its close button, or choose Close split, to go back to one terminal.

On a phone, the terminal offers no split (an open split keeps Close split). Its bar keeps New Terminal and Restart Dev Server, or Kill Terminal on a shell session, and puts the other actions under More actions. A terminal raises the keyboard only when you tap it. See Lyna on your phone.

Type a file path

Drag a file or a folder from the explorer and drop it on a shell. Its path in the project is typed at the prompt, in quotes when it needs them. Nothing runs until you press Enter.

Run code from the editor

In the code editor, select the lines and choose Run Selected Text in Terminal in the right-click menu, or press Cmd/Ctrl + Alt + Enter. With nothing selected, the current line runs.

  • One line runs at once, in the active shell. A new shell opens when none is open.
  • Several lines ask first and list the lines: Run sends them, Cancel or Escape sends nothing.
  • The keyboard stays in the editor, so you can keep typing.

Open a file from the output

A file path with a line that a command prints, such as src/app.tsx:12:5 in an error, is a link: click it and the file opens in the Code panel at that line. Web addresses open in a new tab.

A server you start in the terminal, such as bun run preview, prints the address of its own preview on a Preview: line. Click it to open that server in a new tab. A localhost address opens the same preview, never a page on your own computer.

Terminal actions

ActionWhat it does
New TerminalOpens a new shell session.
Kill TerminalStops the current session.
Clear TerminalClears the output.
Copy TerminalCopies the output.
Search terminalFinds text in the output, with Next and Previous.
Send Selection to AIAdds the selected output to your chat message.
Restart Dev ServerStops and starts the dev server.
Open Preview in New TabOpens the running app in a browser tab.

Terminal settings

Open Terminal settings. Changes apply to every open terminal.

  • Theme: Lyna, Default dark, Light, Solarized Dark, Monokai, Ember or Aurora. It can follow the app theme.
  • Font size and Line height.
  • Font: App mono or System mono.
  • Blinking cursor.
  • Emulation engine: Complete (full escape sequence and Unicode support) or Lightweight (a smaller core with basic escape sequences).
  • Scrollback: Compact, Standard or Extended.
  • Reset to defaults.

Shortcuts

ActionShortcut
Show or hide the bottom panelCmd/Ctrl + J
Run the selected text in the terminalCmd/Ctrl + Alt + Enter
Move to the other pane of a splitCmd/Ctrl + Alt + Left or Right
Rename the focused sessionF2
Command paletteCmd/Ctrl + K

FAQ

Need help?

Ask the team, read what changed, or learn from the blog.