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.
Open and move between terminals
Section titled “Open and move between terminals”| Action | Shortcut |
|---|---|
| Show or hide the panel | Ctrl + ` |
| Create a terminal | Ctrl + Shift + ~ |
| Type the selected names into the terminal | Mod + Enter |
| Previous or next terminal | Ctrl + Page Up / Ctrl + Page Down |
| Focus the panes or terminal | Alt + Up / Alt + Down |
| Maximize the focused terminal or restore the split | Mod + 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.
Context menus
Section titled “Context menus”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.
Clipboard and exited processes
Section titled “Clipboard and exited processes”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.
Font and scrollback
Section titled “Font and scrollback”Under Terminal in Settings, choose the font as a CSS font-family list (the first installed font is used), the font size in pixels, and the number of scrollback lines per terminal (1000 by default). Changes apply to open terminals immediately. The defaults depend on the platform:
| Platform | Default font | Default size |
|---|---|---|
| macOS | Menlo, Monaco, "Courier New", monospace | 12 |
| Linux | "Adwaita Mono", "Source Code Pro", Hack, "DejaVu Sans Mono", monospace | 13 |
| Windows | "Cascadia Mono", Consolas, "Courier New", monospace | 12 |
The newt shell command
Section titled “The newt shell command”Built-in terminals and user commands have a newt command on their path that controls the visible panes from scripts:
newt pwdnewt ls -lhnewt cd ~/projectsnewt focus Cargo.tomlnewt view README.mdnewt edit src/main.rsnewt cat archive.zip/README.txtnewt cp report.pdf ../archive/newt mkdir -p build/reportsnewt select '*.rs' --addnewt cmd copy- Most commands accept
--pane active,other,left, orright. Paths can use mounted forms such ass3://bucket/key, and separators follow the target pane’s filesystem.cat,view, andeditresolve relative paths against the pane, so they work inside archives and S3; the other commands resolve them against the shell’s directory. newt lsprints the pane’s entries as the pane lists them, in its order and with its filter and hidden-file setting, so it also works in archives and S3.-sprints only the selection (or the focused entry),-aevery entry,-la long format likels -l(-hfor K, M, and G sizes),-ppaths instead of names,-0NUL separators, and--jsona JSON array. For example,newt ls -sp0 | xargs -0 du -shhands the selection to another tool.newt selectuses the same glob or/regexsyntax as Select by Pattern. It replaces the selection unless you pass--addor--remove. With no pattern it reads names from standard input, sogit ls-files | newt selectselects those files in the pane.newt cp,newt mv, andnewt rmrun as Newt operations and return at once. With--waitthey return when the operation ends, with status 1 if it failed or was cancelled; Ctrl + C while waiting cancels the operation.newt rmdeletes without asking; directories need-r. Like Delete, it uses the trash when Delete to Trash is on, and then deletes nothing on a filesystem without a trash (S3, SFTP, archives) unless you pass--permanent.newt mkdircreates directories on whatever filesystem the path names, including S3 and SFTP mounts;-pcreates missing parents.newt edit --waitreturns once the editor window closes, soEDITOR='newt edit --wait'letsgit commit,crontab -e, and similar tools use Newt’s editor.newt cmd <id>runs any Command Palette command by its keybinding ID (user_command_Nfor user commands, which can also be named by their title, such asnewt cmd 'Open in Vim'), exiting with status 1 on failure. Runnewt cmdalone to list the IDs.
Run newt --help or newt <command> --help for full syntax and examples.
newt completions prints a completion script for bash, zsh, fish,
elvish, or powershell. Because newt is this command only inside Newt’s
terminals, load it conditionally from your shell’s startup file:
[ -n "$NEWT_SHELL_SOCK" ] && source <(newt completions bash)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.