Skip to content

Terminal and shell

The terminal panel sits below the file panes and can hold several tabs. Each tab keeps its process and scrollback while another tab is active.

ActionShortcut
Show or hide the panelCtrl + `
Create a terminalCtrl + Shift + ~
Type the selected names into the terminalMod + Enter
Previous or next terminalCtrl + Page Up / Ctrl + Page Down
Focus the panes or terminalAlt + Up / Alt + Down
Maximize the focused terminal or restore the splitMod + F11

A new terminal starts in the active pane’s directory; from inside an archive it starts beside the archive. For S3, SFTP, and other mounts with no shell directory, it starts in the session’s default directory. In a remote or elevated session, the shell runs on that target, not on the computer displaying Newt.

Open in Terminal (Mod + Enter) types the selected names, or the focused one, into the active terminal, quoted for Bash, and moves focus there so you can finish the command. If no terminal is open, it opens one first.

While a terminal has focus, keys go to the program running there, even when a Newt command uses the same key; shortcuts such as Ctrl + R or F10 mean something to a shell. The exceptions are the panel commands in the table above (except Open in Terminal) and any binding with when = "terminal_focused".

The maximize button at the right end of the tab bar lets the terminal fill the window; see Maximized layout. While it is maximized, Alt + Up shows the active pane.

Right-click inside a terminal for Copy, Paste, Select All, Clear (clears the scrollback but keeps the prompt), Close Terminal, New Terminal, and maximize and hide commands. Right-clicking a tab also offers Close Other Terminals.

When the program in the terminal uses the mouse, such as tmux, htop, or vim with mouse=a, a right-click goes to the program. Hold Shift while right-clicking to open Newt’s menu, or while dragging to select text.

Copy and paste with Ctrl + Shift + C/V on Linux and Windows, the standard Command shortcuts on macOS, or the context menu. Ctrl + V is sent to the program as ^V. Newt does not ask for confirmation before pasting several lines.

When behavior.keep_terminal_open is enabled, an exited shell stays visible until you press Enter in that tab.

Under Terminal in Settings, choose the font as a CSS font-family list (by default Menlo, Monaco, "Courier New", monospace; the first installed font is used), the font size (12 by default), and the number of scrollback lines per terminal (1000 by default). Changes apply to open terminals immediately.

Built-in terminals and user commands have a newt command on their path that controls the visible panes from scripts:

Terminal window
newt pwd
newt cd ~/projects
newt focus Cargo.toml
newt view README.md
newt edit src/main.rs
newt cat archive.zip/README.txt
newt cp report.pdf ../archive/
newt select '*.rs' --add
newt cmd copy
  • Most commands accept --pane active, other, left, or right. Paths can use mounted forms such as s3://bucket/key, and separators follow the target pane’s filesystem.
  • newt select uses the same glob or /regex syntax as Select by Pattern. It replaces the selection unless you pass --add or --remove. With no pattern it reads names from standard input, so git ls-files | newt select selects those files in the pane.
  • newt cmd <id> runs any Command Palette command by its keybinding ID (user_command_N for user commands), exiting with status 1 on failure. Run newt cmd alone to list the IDs.

Run newt --help or newt <command> --help for full syntax and examples.

Shell integration is controlled by behavior.shell_integration for local sessions and is always available inside remote agent sessions. In a remote session, newt cmd can reach your computer’s clipboard and applications, so it works only when the session has access to this host; the other commands always work.