ngterm ContentsDownload

Documentation

This page tells you how to install, use and configure ngterm. It also tells you how to control ngterm from scripts and coding agents.

For ngterm 0.2.14.

Contents
  1. Overview
  2. Install
  3. Get started
  4. Workspaces and sessions
  5. Terminals
  6. Navigation
  7. Windows
  8. Agent status
  9. Notifications
  10. Pages and viewers
  11. The page bridge
  12. Restore and Live sessions
  13. Remote machines
  14. Phone and tablet apps
  15. Settings
  16. Ghostty config and themes
  17. Keys and custom commands
  18. Event hooks
  19. Files and folders
  20. ngtermctl reference
  21. The agent skill
  22. Accessibility
  23. Troubleshooting
  24. Build from source and contribute

Overview #

ngterm is a terminal for many coding agents at the same time. It runs on Linux, Windows and macOS. Apps for Android and iOS connect to your computers over ssh.

Each agent runs in a named session. Sessions are in groups, called workspaces, in a sidebar. The sidebar shows which agent works, which agent is blocked and which agent is done. With Live sessions, your programs continue to run when you quit or update ngterm. The next start connects to them again.

Almost all that you can do with the mouse, a script can do with ngtermctl. The agent skill teaches your agent to use ngtermctl. Terminal emulation comes from the engine of Ghostty, and the GPU draws the terminal.

The model #

ngterm keeps your work in a tree with four levels:

  1. A window is the top level. Each window has its own sidebar, workspaces and sessions. ngterm keeps a library of windows, and a window can be open or closed.
  2. A workspace is a named group of sessions, usually for one project.
  3. A session is one row in the sidebar. It has a name, a working directory and an agent status.
  4. A pane is one terminal in a session. A session has one pane, or two panes when you split it.

A session can also have these parts:

The app also has one quick terminal. It is a shell in a floating panel that is not part of a window. A page shows HTML, Markdown, an image or a source file. It shows in an overlay or as a session of its own (see Pages and viewers). A remote session runs on another computer and shows as a row in your sidebar (see Remote machines).

Words on this page #

WordMeaning
sidebarThe column at the left of a window, with the workspace rows and session rows.
title barThe bar at the top of a window. It shows the session name and the buttons that you set in Settings ▸ Interface.
main menuThe menu button at the right end of the title bar (Main Menu). On Linux and Windows, it holds the File, View, Navigate and Help menus.
active sessionThe session that is selected in a window.
agent statusThe state that an agent reports: active, blocked or completed. The sidebar shows it as a glyph (see Agent status).
attentionA session asks for attention when its status is blocked or completed.
flagA mark on a session. The flagged view shows only flagged sessions.
focus setThe workspaces that you mark. The workspace filter shows only these workspaces.
command paletteA searchable list of all commands.
Live sessionsThe restore mode that keeps programs alive when ngterm quits (see Restore and Live sessions).
ngtermctlThe command line tool that controls ngterm (see ngtermctl reference).

Menus and keys on each platform #

On macOS, the menus are in the menu bar: ngterm, File, Edit, View, Navigate and Help. On Linux and Windows, click the Main Menu button at the right end of the title bar. It holds File, View, Navigate and Help, then Settings… and Quit. On macOS, the title bar also has the Main Menu button.

The default keys on Linux and Windows use CtrlShift as the base. The default keys on macOS use ⌘. Each menu item shows its current key. When you hold the pointer over a title bar button, its tooltip also shows the key. You can change all keys in keymap.conf (see Keys and custom commands).

Install #

Download ngterm from the Releases page. Each release has these files. VERSION is the release number, for example 0.2.13.

PlatformFileKind
Debian, Ubuntungterm_VERSION-1_amd64.deb, ngterm_VERSION-1_arm64.debSystem package
Fedora, openSUSEngterm-VERSION-1.x86_64.rpm, ngterm-VERSION-1.aarch64.rpmSystem package
Arch Linuxngterm-VERSION-1-x86_64.pkg.tar.zst, ngterm-VERSION-1-aarch64.pkg.tar.zstSystem package
Linux, any distributionngterm-VERSION-linux-x86_64.AppImage, ngterm-VERSION-linux-aarch64.AppImageAppImage
Linux, any distributionngterm-VERSION-linux-x86_64.tar.gz, ngterm-VERSION-linux-aarch64.tar.gzPortable archive
Windowsngterm-VERSION-windows-x86_64.msiInstaller for one user
Windowsngterm-VERSION-windows-x86_64.zipPortable archive
macOSngterm-VERSION-macos-arm64.dmg, ngterm-VERSION-macos-x86_64.dmgDisk image
macOSngterm-VERSION-macos-arm64.pkg, ngterm-VERSION-macos-x86_64.pkgInstaller
macOSngterm-VERSION-macos-arm64.app.zip, ngterm-VERSION-macos-x86_64.app.zipApp bundle in a zip
macOSngterm-VERSION-macos-arm64.tar.gz, ngterm-VERSION-macos-x86_64.tar.gzBinaries without a bundle
Androidngterm-VERSION-android.apkSigned app
iOSngterm-VERSION-ios-unsigned.ipaUnsigned app

On macOS, arm64 is for Apple silicon and x86_64 is for Intel. Each release also has SHA256SUMS and SHA256SUMS.minisig (see Verify a download).

System requirements #

PlatformRequirements
Linuxx86_64 or aarch64. glibc 2.39 or newer and libstdc++ 13 or newer: Ubuntu 24.04 or newer, or a current Debian, Fedora, Arch or openSUSE. A Vulkan graphics driver. bubblewrap and xdg-dbus-proxy. Wayland or X11.
Windowsx86_64. HTML pages use the Microsoft Edge WebView2 Runtime. Windows 11 includes it. Windows 10 can be without it.
macOSmacOS 14 or newer, on Apple silicon or Intel. A Mac with Metal.
AndroidAndroid 8.0 or newer.
iOSiOS 26 or newer.

The system packages declare all the Linux libraries that ngterm uses. The release files do not support Alpine Linux and other musl systems. On these systems, build ngterm from source (see Build from source).

On Linux, HTML pages use WPE WebKit 2.54 or newer. The first time that you open a page, ngterm looks for it on your system. If your system does not have it, ngterm downloads a web engine of about 120 MB one time. The Arch package installs the system engine. The .deb and .rpm packages recommend it where the distribution has version 2.54 or newer. See Pages and viewers.

Install on Linux #

To install a system package, use the package manager of your distribution:

sudo apt install ./ngterm_VERSION-1_amd64.deb             # Debian, Ubuntu
sudo dnf install ./ngterm-VERSION-1.x86_64.rpm            # Fedora
sudo zypper install ./ngterm-VERSION-1.x86_64.rpm         # openSUSE
sudo pacman -U ngterm-VERSION-1-x86_64.pkg.tar.zst        # Arch Linux

A system package installs ngterm in /opt/ngterm. It puts ngterm, ngtermctl, ngterm-session and ngterm-headless on your PATH. It also adds ngterm to the application menu of your desktop. If no other package has the xterm-ghostty terminfo entry, the .deb and .rpm packages add it to the system terminfo. The x86_64 Arch package depends on ghostty-terminfo, which has the entry. Thus a root shell, for example sudo -i in a pane, finds the entry too. The aarch64 Arch package does not add the entry, because Arch Linux ARM has no package for it.

To use the AppImage:

  1. Make the file executable: chmod +x ngterm-VERSION-linux-x86_64.AppImage.
  2. Run the file.

The AppImage uses FUSE. If your system does not have FUSE, run the AppImage with --appimage-extract-and-run.

To use the portable archive:

  1. Extract the archive: tar -xzf ngterm-VERSION-linux-x86_64.tar.gz. This makes a folder with the name ngterm.
  2. Run ngterm/AppRun.

Keep all the files of the archive together in the ngterm folder. For automatic updates, your user must have write permission on the parent folder of ngterm.

Install on Windows #

To install with the installer:

  1. Run ngterm-VERSION-windows-x86_64.msi.
  2. If Windows SmartScreen shows a warning, click More info, then Run anyway.

The installer does not ask for administrator rights. It installs ngterm for your user in %LOCALAPPDATA%\Programs\ngterm. It adds a Start menu shortcut, and it puts the folder of ngtermctl.exe on your PATH. The installers are not signed yet, thus SmartScreen can show a warning.

To use the portable archive:

  1. Extract ngterm-VERSION-windows-x86_64.zip. Keep the ngterm folder that it makes.
  2. Run ngterm\bin\ngterm.exe.

Install on macOS #

To install from the disk image:

  1. Open ngterm-VERSION-macos-arm64.dmg (Apple silicon) or ngterm-VERSION-macos-x86_64.dmg (Intel).
  2. Drag ngterm to the Applications folder.

The .pkg installer puts ngterm.app in /Applications. The .app.zip file holds the same app bundle. The .tar.gz file holds the bin and share folders without a bundle. To use it, make a folder with the name ngterm and extract the archive into it.

The macOS builds are not notarized yet. Thus macOS can stop the first start of ngterm. To start ngterm the first time:

  1. Open ngterm. If macOS stops it, close the message.
  2. Open System Settings ▸ Privacy & Security.
  3. Find the message about ngterm and click Open Anyway.

Install the phone and tablet apps #

On Android, download the .apk file on the device, then open it. Android asks you to let the source of the download install apps. You can also install the file from a computer with adb install ngterm-VERSION-android.apk.

The iOS .ipa file is not signed. Before you install it, you must sign it again with a sideloading tool or with your own Xcode team.

For the setup of the apps, see Phone and tablet apps.

The first start #

The first time that ngterm starts, it shows Welcome to ngterm. This message offers two installs:

Click Install to install the selected items, or click Later. The message does not show again. The Help menu has the same installers at all times. For the next steps, see the first steps.

Updates #

ngterm looks for a new release when it starts and every six hours. It downloads the release in the background and examines the signature. When the update is ready, the title bar shows Install Update.

To install an update:

  1. Click Install Update in the title bar, or select Help ▸ Check for Updates….
  2. If ngterm asks for your password, type it.

ngterm saves your windows, installs the update and starts again. Live sessions connect again. Other shells close and come back as your restore mode tells (see Restore and Live sessions). If you quit while an update is ready, ngterm installs it at the quit, but it does not start again. System packages and the macOS .pkg install only from the button, because a quit cannot ask for a password.

Kind of installHow the update installs
.deb, .rpm, Arch packageThrough apt, dnf, zypper, rpm or pacman. ngterm asks for your password through polkit. If your desktop has no polkit agent, ngterm runs sudo in a new session.
macOS .pkg in /ApplicationsThrough the macOS installer. macOS asks for an administrator password.
AppImagengterm replaces the original AppImage file.
Windows .msiThrough Windows Installer, without administrator rights.
Portable archive, macOS app from the .dmg or the .app.zipngterm replaces the installed files. If the replacement fails, ngterm restores the earlier version.

To stop the automatic checks and downloads, set Settings ▸ General ▸ Automatically download updates to off. Help ▸ Check for Updates… continues to work. Builds that other people package, and builds from source, do not update themselves.

The Android app tells you about a new release and installs it from its settings (see Phone and tablet apps). The iOS app does not update itself.

Verify a download #

Each release has SHA256SUMS, a list of the checksums of all files. SHA256SUMS.minisig is the minisign signature of that list. Each file also has a GitHub build attestation.

To verify a download:

  1. Put the download, SHA256SUMS and SHA256SUMS.minisig in one folder.

  2. Verify the signature of the list:

    minisign -Vm SHA256SUMS -x SHA256SUMS.minisig -P RWSX4LSrCmx6JMEuC+YIcKqnCodkV06ovAhb1umcA7Jcl0XOiecnn9ZP
    
  3. Make sure that the trusted comment is ngterm vVERSION SHA256SUMS.

  4. Verify the checksum of the download. Write the name of your file in place of FILE. On Linux, use this command:

    grep " FILE$" SHA256SUMS | sha256sum --check
    

    On macOS, use this command:

    grep " FILE$" SHA256SUMS | shasum -a 256 -c
    

    The result must be FILE: OK. If the command shows no line for your file, the file name is not the name of the release asset. Do not use the file.

  5. Optional: verify where GitHub built the file:

    gh attestation verify ngterm-VERSION-linux-x86_64.tar.gz --repo nickalie/ngterm
    

To examine the signer of the Android app, run apksigner verify --print-certs ngterm-VERSION-android.apk. Compare the result with packaging/android/apk-certificate.sha256.

ngterm uses the same minisign key when it updates itself. It does not install an update with a signature that does not match.

Uninstall #

If you use Live sessions, their programs continue to run after you quit ngterm. To stop them before you uninstall:

  1. Set Settings ▸ General ▸ Restore sessions to Fresh shells.
  2. Quit ngterm and start it again. This stops all detached Live session processes.
  3. Quit ngterm.

To remove ngterm:

InstallHow to remove it
.debsudo apt remove ngterm
.rpmsudo dnf remove ngterm or sudo zypper remove ngterm
Arch packagesudo pacman -R ngterm
AppImage, portable archiveDelete the AppImage file or the ngterm folder.
Windows .msiUninstall ngterm from the list of installed apps in Windows Settings. This also removes the PATH entry.
macOSMove ngterm.app from /Applications to the Trash.

If you used Help ▸ Install Command Line Tool… on Linux or macOS, also delete the link ~/.local/bin/ngtermctl.

An uninstall does not remove your settings and your saved sessions. To remove them too, delete these folders:

PlatformConfigurationState
Linux, macOS~/.config/ngterm~/.local/share/ngterm
Windows%APPDATA%\ngterm%LOCALAPPDATA%\ngterm

For all paths, see Files and folders.

Get started #

This section shows the first steps after you install ngterm.

Connect your agents #

On the first start, ngterm offers to install the agent skill and the agent status hooks. If you clicked Later, use the Help menu:

  1. Select Help ▸ Install Agent Status Hooks….
  2. Select Help ▸ Install Agent Skill….
  3. Start a new agent in a session.

The agent status then shows on the session row in the sidebar. With the skill, you can ask your agent to split a pane, show a page or make a custom command for you. For the supported agents and the details, see Agent status and The agent skill.

Learn the essential keys #

These are the default keys. Each menu item shows its key too.

ActionLinux and WindowsmacOS
New sessionCtrlShiftT⌘N
New workspaceCtrlShiftW⇧⌘N
New windowCtrlShiftN⌥⌘N
Close sessionCtrlShiftQ⌘W
Split side by sideCtrlShiftD⌘D
Split top and bottomCtrlShiftH⇧⌘D
Scratch terminalCtrlShiftJ⌘J
Quick terminalCtrl`⌃`
Find in the terminalCtrlShiftF⌘F
Terminal zoomCtrlShiftEnter⇧⌘↩
DashboardCtrlShiftM⇧⌘G
Go to a sessionCtrlP⌃P
Command paletteCtrlShiftP⌃⇧P
Previous session, next sessionCtrlShift↑, CtrlShift↓⌥⌘↑, ⌥⌘↓
Search the sessions in the sidebarCtrlAltShiftFNo default key
Copy, pasteCtrlShiftC, CtrlShiftV⌘C, ⌘V
SettingsNo default key⌘,

On Linux and Windows, open Settings from Main Menu ▸ Settings… or from the command palette. When you do not know a key, open the command palette and type a part of the command name.

Turn on Live sessions #

The default restore mode is Fresh shells. In this mode, the programs in your sessions stop when you quit ngterm. With Live sessions, they continue to run, and ngterm connects to them again at the next start.

  1. Open Settings ▸ General.
  2. Set Restore sessions to Live sessions.
  3. Quit ngterm and start it again.

On Linux and macOS, Live sessions use bash, zsh, fish or PowerShell. On Windows, they use PowerShell, Git Bash, Command Prompt or WSL. For the details, see Restore and Live sessions.

Put ngtermctl on your PATH #

The terminals of ngterm find ngtermctl without this step: ngterm adds its own folder to their PATH. Hooks and custom commands also find it.

The system packages for Linux and the Windows installer put ngtermctl on your PATH for all other terminals. For other installs, do these steps to use ngtermctl outside ngterm:

  1. Select Help ▸ Install Command Line Tool….
  2. Open a new terminal and run ngtermctl --help.

On Linux and macOS, this command makes the link ~/.local/bin/ngtermctl. If ~/.local/bin is not on your PATH, the message tells you. Then add the folder in the startup file of your shell. On Windows, the command adds the folder of ngtermctl.exe to the PATH of your user.

Make your first layout #

  1. Push CtrlShiftW (⇧⌘N on macOS) to make a workspace.
  2. Double-click the new workspace row.
  3. Type a name for the workspace.
  4. Push Enter.
  5. Right-click the workspace row.
  6. Select Open Directory….
  7. Select a project folder. ngterm opens a session in that folder.
  8. Start your agent in the session.
  9. Push CtrlShiftD (⌘D on macOS) to split the session for a second shell.

ngterm saves the layout. At the next start, it opens the same windows, workspaces and sessions.

The configuration files are in ~/.config/ngterm on Linux and macOS and in %APPDATA%\ngterm on Windows. Keys are in keymap.conf, event hooks are in hooks.conf and terminal settings are in ghostty.conf. See Keys and custom commands, Event hooks and Ghostty config and themes.

Workspaces and sessions #

A workspace is a named group of sessions, usually for one project. A session is one row in the sidebar, with one or two terminals. A session can move to another workspace while its programs continue to run.

The sidebar #

The sidebar shows a tree with two levels: workspace rows, and the session rows in each workspace. Each row starts with an icon. A workspace row has a grid icon. A session row has a terminal icon, or a split icon when the session is split. A filled icon shows a flagged session.

A session row can show this information:

The footer of the sidebar has four buttons:

ButtonWhat it does
New WorkspaceMakes a workspace.
New Session (the plus icon)Opens a menu: New Session, the shell profiles, and Open Directory….
Workspace filter (the grid icon)Shows only the workspaces in the focus set, or shows all workspaces again.
Flagged view (the flag icon)Shows only the flagged sessions, or shows all sessions again.

When you hold the pointer over a workspace row, it shows a + button. Click it to make a session in that workspace.

To show or hide the sidebar, push CtrlShiftS (⌃⌘S on macOS) or click the sidebar button in the title bar. To change the width of the sidebar, drag the line between the sidebar and the terminal.

Settings ▸ Interface ▸ Sidebar sets which buttons and icons the sidebar shows. It also sets Session info (Always, Flagged or Off) and Active window only, which hides the sidebar of the windows that are not active. Settings ▸ Appearance sets Sidebar font size, Sidebar density and Sidebar Tint.

Make a session #

ActionLinux and WindowsmacOSMenu
New session in the current workspaceCtrlShiftT⌘NFile ▸ New Session
New session in a folder that you selectCtrlShiftO⌘OFile ▸ Open Directory…
New session in the same folder, after the current oneNo default keyNo default keyFile ▸ Duplicate Session

You can also drag up to 20 folders from your file manager onto the sidebar. ngterm opens one session for each folder. A drop on a row puts the sessions in the workspace of that row. A drop on empty space puts them in the current workspace. When you hold a drag over a collapsed workspace, the workspace expands.

Duplicate Session makes a new shell in the folder of the focused pane. Only the folder carries over. The name, the command, the split and the status do not carry over.

These settings in Settings ▸ General control a new session:

SettingValues
New sessions open inHome directory, Current session’s directory or Custom directory
New sessions are addedAt the end of the workspace or After the current session
Name sessions after the terminal titleOn: the terminal title names a session. Off: the folder name names a session.
Default shellThe shell profile for new sessions. This setting shows on Windows, and on other platforms when you have custom profiles.

On Windows, the New Session menu in the sidebar footer lists the shells that ngterm finds: PowerShell, Windows PowerShell, Git Bash, Command Prompt and the installed WSL distributions. Select one to open a session with that shell. In Live sessions mode, a profile that Live sessions cannot keep shows (fresh shell) after its name.

Rename, copy and tint #

To rename a session or a workspace, double-click its row, or right-click the row and select Rename. Type the name and push Enter. To go back to the automatic name of a session, delete the name and push Enter. File ▸ Rename Session and File ▸ Rename Workspace do the same for the current row.

To copy the name of a row, right-click the row and select Copy Name.

To give a row a color, right-click the row and select Tint. The colors are Red, Orange, Yellow, Green, Blue, Purple, Gray, Teal, Pink, Brown, Indigo and Mint. None removes the tint. Under Show On, select Icon, Name or Icon and Name. The command palette also has the rows Tint Session: Red and so on. To set any other color, use ngtermctl session tint with a #rrggbb value.

Select more than one session #

When you right-click a row in the selection, the menu acts on all selected sessions. You can flag, tint, move, close and drag them together. When you right-click a row outside the selection, the menu acts on that row only.

Move and reorder #

To move a session, drag its row:

To move a session to another workspace from a menu, right-click the row and select Move to, then the workspace. The command palette has the same rows: Move Session to and the workspace name. A moved session keeps its shell, its scrollback and its flag.

To reorder the workspaces, drag a workspace row up or down.

A session stays in its window. You cannot move a session to another window.

Close and reopen #

ActionLinux and WindowsmacOSMenu
Close the sessionCtrlShiftQ⌘WFile ▸ Close Session
Undo the last closeCtrlShiftZ⌘ZFile ▸ Reopen Closed Item
Reopen the last closed session or workspaceCtrlAltShiftT⇧⌘TFile ▸ Reopen Last Closed Item
Reopen an item from a listNo default keyNo default keyFile ▸ Open Recent
Delete the workspaceNo default keyNo default keyFile ▸ Delete Workspace

The close key closes the top item first. If the session shows a dialog, the quick terminal, a terminal zoom, the dashboard, an overlay or the scratch terminal, the key closes that item. When none of these show, it closes the session.

After a close, ngterm keeps the session for 3 seconds. During this time, Reopen Closed Item puts it back, and its programs continue to run. To close sessions at once, set Settings ▸ General ▸ Allow undo after closing sessions and workspaces to off. To see a confirmation before each close, set Confirm before closing a session to on.

File ▸ Open Recent lists the last 20 closed sessions and workspaces. Select an item to open it again, or select Clear Menu. A reopened item comes back with its name and layout, but its old programs do not.

Delete Workspace asks for a confirmation when the workspace has sessions. You cannot delete the last workspace of a window. After a close, ngterm selects the session that you used most recently, in the same workspace when possible.

Collapse and expand workspaces #

Click the icon or the arrow of a workspace row to collapse or expand it. A click on the row does the same, unless you set Settings ▸ General ▸ Click a workspace row to expand or collapse to off.

The View menu has these commands: Collapse Workspace (or Expand Workspace), Expand Workspaces and Collapse Workspaces. Collapse Workspaces collapses all workspaces except the current one.

Flag sessions #

A flag puts a session in your working set, across all workspaces of the window. A flag stays when you move the session and when you restart ngterm.

ActionLinux and WindowsmacOSMenu
Flag or unflag the sessionCtrlShiftG⇧⌘FView ▸ Flag Session
Show only flagged sessionsNo default keyNo default keyView ▸ Show Flagged Sessions
Flag or unflag a list of sessionsNo default keyNo default keyView ▸ Edit Flagged Sessions…
Unflag all sessionsNo default keyNo default keyView ▸ Clear Flagged

You can also right-click a session row and select Flag. Right-click a workspace row and select Flag All Sessions to flag each session in it.

Edit Flagged Sessions… opens a list of all sessions in the window. Push Enter or click a row to flag or unflag it. The list stays open until you push Esc.

Settings ▸ General ▸ Flagged view layout sets how the flagged view shows the sessions:

Focus on some workspaces #

The focus set is a group of workspaces that you mark. The workspace filter then shows only these workspaces.

ActionMenu
Show only the current workspace, or show all againView ▸ Focus Workspace (or Unfocus Workspace)
Add the current workspace to the focus setView ▸ Add Workspace to Focus
Apply the filter, or stop itView ▸ Toggle Workspace Filter
Remove all workspaces from the focus setView ▸ Clear Focus
Mark or unmark workspaces from a listView ▸ Edit Focused Workspaces…

You can also right-click a workspace row and select Focus, Add to Focus or Remove from Focus. The grid button in the sidebar footer applies the filter or stops it. ngterm keeps the focus set for each window across restarts.

A new workspace that you make while the filter is on joins the focus set. If you select a session outside the focus set, ngterm stops the filter but keeps the set. If the filter or the flagged view hides the active session, ngterm selects the most recent session that still shows.

Companion sessions #

A companion is an ordinary session that stays under a parent session. Use it for a program of the same task: a log tail, a watcher or a second shell. The companion shows after its parent, indented.

ActionMenuWhat it makes
New companionFile ▸ New CompanionA shell in the folder of the parent.
Duplicate as companionFile ▸ Duplicate as CompanionA copy of the layout of the session, with a new copy of the program in each pane.
Convert to companionFile ▸ Convert to CompanionA new shell takes the place of the session, and the session moves under it.

These commands are also in the row menu and in the command palette. They have no default keys. In keymap.conf, the actions are new_companion, duplicate_companion and convert_companion.

If Duplicate as Companion cannot copy the program of a pane, ngterm makes nothing and tells you which pane caused the problem.

Some rules for companions:

The palettes and the session switcher show a companion as parent › companion. To make a companion from a script, run ngtermctl session new --parent active --command 'tail -f build.log' --name logs.

The session row menu #

Right-click a session row to open its menu. Some items show only for one session or in some conditions.

ItemWhat it does
Clear StatusSets the agent status of the session to idle.
Mark for AttentionSets the status of an idle session to completed.
RenameStarts a rename of the row.
Copy NameCopies the session name to the clipboard.
Duplicate SessionMakes a new shell in the same folder, after the session.
New Session on hostFor a remote session: makes a new session on that machine.
New Companion, Duplicate as Companion, Convert to CompanionSee Companion sessions.
Move toMoves the sessions to another workspace.
Flag, UnflagFlags or unflags the sessions.
TintSets the row color.
Reveal in FilesOpens the folder of the focused pane in your file manager.
End Session on host…For a remote session: stops the session on that machine.
Close SessionCloses the sessions.

The workspace row menu has Rename, Copy Name, New Session, Open Directory…, Collapse Workspace, Focus, Add to Focus, Flag All Sessions, Tint and Delete Workspace.

Terminals #

Each session holds one or more terminals. This section tells how to split them, cover them, zoom them, search them and copy from them.

Split a session #

A split gives a session a second terminal. Both terminals share one row in the sidebar.

ActionLinux and WindowsmacOSMenu
Split side by side, or hide the splitCtrlShiftD⌘DView ▸ Toggle Vertical Split
Split top and bottom, or hide the splitCtrlShiftH⇧⌘DView ▸ Toggle Horizontal Split
Focus the left (top) paneCtrlShift←⌥⌘←Navigate ▸ Focus Left Pane
Focus the right (bottom) paneCtrlShift→⌥⌘→Navigate ▸ Focus Right Pane
Exchange the two panesNo default keyNo default keyView ▸ Swap Panes
Close the second paneNo default keyNo default keyCommand palette: Close Split

When you push the key of the shown direction, the split hides, but its shell continues to run. Push the key again to show it. When you push the key of the other direction, the split turns to that direction.

Drag the line between the panes to change their sizes. Double-click the line to make the panes equal again. ngterm keeps the position of the line. Click a pane to give it the keyboard.

Swap Panes exchanges the two terminals without a restart of their programs. Close Split stops the second pane and the program in it.

The scratch terminal #

The scratch terminal is an extra shell for one session. Use it for a quick task beside your main work. It covers the full session.

To show or hide it, push CtrlShiftJ (⌘J on macOS), or select View ▸ Show Scratch. The title bar has a scratch button too. When you hide the scratch terminal, its shell continues to run. While it shows, the split keys hide it.

In Live sessions mode, the scratch terminal runs in a live session of its own. It continues to run when you quit ngterm, and it comes back hidden at the next start. In the other modes, the scratch terminal is temporary, and ngterm does not restore it after a restart.

The quick terminal #

The quick terminal is one shell for the full app. It is not part of a window or a session. It opens in a floating panel on the screen that has the focus, in the folder of the active session.

To show or hide it, push Ctrl` (⌃` on macOS), or select View ▸ Quick Terminal. When you click outside the panel, it hides. Its shell continues to run. ngterm does not restore the quick terminal after a restart.

Settings ▸ Interface ▸ Quick Terminal ▸ Size sets the size of the panel as a part of the screen.

To show the quick terminal from any application, add a system-wide key to keymap.conf:

global-hotkey ctrl+alt+space

The system-wide key works on X11, on Windows and on macOS. On Wayland, it uses the global shortcuts portal of your desktop: KDE Plasma, GNOME 48 and newer, and Hyprland. Other Wayland compositors do not give a global key to an app. On these compositors, bind a key in the compositor to ngtermctl quick toggle.

Terminal zoom #

Terminal zoom fills the full window with one terminal: a pane, the scratch terminal or an overlay. The sidebar hides, and the title bar becomes a thin strip with an exit button.

To zoom or to stop the zoom, push CtrlShiftEnter (⇧⌘↩ on macOS), or select View ▸ Toggle Terminal Zoom. The close key (CtrlShiftQ or ⌘W) also stops the zoom.

A zoom does not change the layout. When the zoom stops, the split sizes, the focus and the hidden parts are the same as before. All programs continue to run during the zoom.

Find text in the terminal #

To search the scrollback of a terminal:

  1. Push CtrlShiftF (⌘F on macOS), or select View ▸ Find….
  2. Type the text. The bar shows the number of matches, for example 2 of 7.
  3. Push Enter to go to the next match.
  4. Push ShiftEnter to go to the previous match.
  5. Push Esc to close the bar.

The search bar shows at the top right of the terminal. When a text page shows on top of the session, the same key searches that page.

Font size #

ActionLinux and WindowsmacOSMenu
Increase the font sizeCtrl=⌘ and the plus keyView ▸ Increase Font Size
Decrease the font sizeCtrl-⌘-View ▸ Decrease Font Size
Reset the font sizeCtrl0⌘0View ▸ Actual Size

These keys change the focused pane only. ngterm keeps the font size of the main pane after a restart. The default size is in Settings ▸ Appearance ▸ Font size. When an HTML page covers the pane, the keys zoom the page.

To change the theme, select View ▸ Select Theme…. See Ghostty config and themes.

Scroll #

Use the mouse wheel or the touchpad to scroll. These keys also scroll the terminal:

ActionKey
Scroll one page up, one page downShiftPage Up, ShiftPage Down
Go to the top, go to the bottomShiftHome, ShiftEnd

Settings ▸ General ▸ Scroll speed sets the speed of the mouse wheel.

Overlays #

An overlay runs one program in a temporary terminal on top of a session. When the program stops, the overlay closes and the session is the same as before. Usually a script or an agent opens an overlay:

ngtermctl session overlay open htop --size-percent 80

An overlay can cover the full session, float over it in a frame, or cover only one pane of a split. An overlay can also show a page: HTML, a web address, an image, Markdown or a text file (see Pages and viewers).

ActionLinux and WindowsmacOSMenu
Hide all overlays of the session, or show them againCtrlAltShiftJ⇧⌘JView ▸ Hide Overlays (or Show Overlays)
Close the overlay on topCtrlShiftQ⌘WFile ▸ Close Session

A hidden program continues to run. The session can hold only one session-wide overlay. To add a hide button to the title bar, set Settings ▸ Interface ▸ Hide overlays to on.

A HUD is a small panel with a message, for example from an agent. It does not take the keyboard, and you can type in the session under it. To open a link in a HUD, Ctrl-click it (⌘-click on macOS). For all overlay commands, see ngtermctl reference.

Copy and paste #

To select text, drag with the mouse. Double-click selects a word. Triple-click selects a line. Shift-click extends the selection. On Linux and Windows, hold CtrlAlt and drag to select a block.

ActionLinux and WindowsmacOS
Copy the selectionCtrlShiftC or CtrlInsert⌘C
Paste the clipboardCtrlShiftV⌘V
Select allCtrlShiftA⌘A
Paste the selectionMiddle-click or ShiftInsertMiddle-click
Paste the clipboard with the mouseRight-clickRight-click

A selection does not go to the system clipboard. It goes to a separate selection clipboard, which middle-click pastes. On Linux, this is the primary selection of your desktop. To also copy each selection to the system clipboard, add copy-on-select = both to ghostty.conf.

Right-click pastes by default. To stop this, set Settings ▸ General ▸ Right-click pastes to off.

When a program asks to read the clipboard, ngterm asks you first. Click Allow or Deny. Select Don’t ask again this session to keep your answer until ngterm quits.

In a session that runs on another computer, a pasted image goes to that computer as a file. ngterm then pastes the file name. See Remote machines.

To open a link in the terminal, hold Ctrl (⌘ on macOS) and click the link. When you hold the key, the link shows an underline and the pointer becomes a hand. ngterm finds web addresses, file paths and the links that programs make with OSC 8.

ClickWhat it does
Ctrl-click (⌘-click) a web addressOpens the link as Settings ▸ General ▸ Open links in tells: in your browser, or in a session overlay.
CtrlShift-click (⇧⌘-click) a web addressOpens the link in your browser, when the setting is a session overlay.
Ctrl-click (⌘-click) a file pathOpens an image, a Markdown file, a source file or a log in a viewer over the session. Other files show in your file manager.
CtrlAlt-click (⌥⌘-click) a file pathShows the file in your file manager.

ngterm finds a relative path from the folder of the pane. A path that ends in :line or :line:column opens at that line. ngterm does not open other files in their default application, because a file can be a script. For the viewers, see Pages and viewers.

Drag and drop #

You can drag folders from your file manager onto the sidebar to open sessions there (see Make a session). The terminal itself does not accept dropped files.

You can do all work in ngterm with the keyboard. Most commands have a menu item and a row in the command palette. Three palettes, a session switcher and the sidebar search help you go to a session fast.

ActionLinux and WindowsmacOSMenu
Go to a session by nameCtrlP⌃PNavigate ▸ Go to Session
Command paletteCtrlShiftP⌃⇧PNavigate ▸ Command Palette
Custom commands paletteCtrlAltShiftO⌃⇧ONavigate ▸ Custom Commands
Sessions that ask for attentionCtrlShiftI⌃⇧INavigate ▸ Go to Attention…
DashboardCtrlShiftM⇧⌘GNavigate ▸ Dashboard
Previous sessionCtrlShift↑⌥⌘↑Navigate ▸ Previous Session
Next sessionCtrlShift↓⌥⌘↓Navigate ▸ Next Session
Previous session that asks for attentionAltShift↑⌃⌥↑Navigate ▸ Previous Attention Session
Next session that asks for attentionAltShift↓⌃⌥↓Navigate ▸ Next Attention Session
First session, last sessionNo default keyNo default keyNavigate ▸ First Session, Last Session
Previous workspace, next workspaceNo default keyNo default keyNavigate ▸ Previous Workspace, Next Workspace
Previous window, next windowNo default keyNo default keyNavigate ▸ Previous Window, Next Window
Recently used sessionsCtrlTab⌃TabNone
Search the sessions in the sidebarCtrlAltShiftFNo default keyView ▸ Search Sessions…

The previous and next steps go through the sessions that the sidebar shows. In the flagged view, they go through the flagged sessions. With the workspace filter, they go through the workspaces in the focus set. At the end of the list, they start again at the other end. Workspace steps work only in the ordinary tree view.

A palette is a search field with a list of rows. It works the same in all modes:

  1. Open the palette with its key.
  2. Type a part of the name. The list shows the best matches first.
  3. Push ↑ and ↓, or CtrlK and CtrlJ, to move the selection.
  4. Push Enter or click a row to run it.

Push Esc or click outside the palette to close it. The key that opened a palette also closes it.

The Go to Session palette lists the sessions of the window, with the agent status of each one. In the flagged view and with the workspace filter, it lists only the sessions that the sidebar shows. Each row shows the workspace and the terminal title or the folder under the name. You can search all of these words.

The Command Palette lists all commands, with their keys. It also has rows that the menus do not have:

A command that cannot run now shows dimmed, but it stays in the list. Some rows show only when they apply. For example, Close Split and the pane focus rows show only when the session has a split.

The Custom Commands palette lists the commands from keymap.conf (see Keys and custom commands). The title bar can also show a custom commands button. To show it, set Settings ▸ Interface ▸ Custom commands to on.

The session switcher walks through the sessions that you used most recently.

  1. Hold Ctrl.
  2. Push Tab one or more times. Push ShiftTab to go back.
  3. Release Ctrl to go to the selected session.

Push Esc to stop without a change. One push of CtrlTab goes back to the session that you used before. ngterm keeps this order after a restart.

The clock button in the title bar shows the same list for the mouse. Click a row to go to that session.

The search field is in the title bar, above the sidebar. Type in it to show only the sessions with a name that contains the text. The search ignores upper case and lower case. A companion that matches also shows its parent.

Key in the fieldWhat it does
↑, ↓Moves the cursor to the previous or next match.
EnterOpens the match under the cursor and gives the keyboard to its terminal.
EscClears the field and gives the keyboard back to the terminal.

The search changes only what the sidebar shows. It does not change the session steps, the switcher or ngtermctl session go. ngterm does not save the search.

A session asks for attention when its agent is blocked or completed. These tools find these sessions:

Two settings in Settings ▸ Agent Status ▸ Navigation change these steps. Attention navigation includes active sessions also stops at sessions that are active. Attention navigation crosses windows lets the steps go to other open windows. See Agent status.

The dashboard shows the live output of up to nine panes in one grid over the window. Use it to watch several agents at the same time.

  1. Push CtrlShiftM (⇧⌘G on macOS), or click the dashboard button in the title bar.
  2. Push the arrow keys to move the highlight.
  3. Push Enter, or click a cell, to go to that pane.

Push Esc to close the dashboard. The dashboard shows the sessions that you used most recently. A split session uses two cells. You cannot type in the terminals of the grid. The name of each cell shows the color of its agent status.

To show other sessions, use ngtermctl dashboard with the session ids. See ngtermctl reference.

When you close the active session, ngterm selects the session that you used most recently. It stays in the same workspace when possible. In the flagged view, it stays in the flagged sessions. With the workspace filter, it stays in the focus set.

Windows #

A window has its own sidebar, workspaces and sessions. For example, you can keep one window for work and one window for personal projects. ngterm keeps all windows in a library. A window can be open on the screen or closed.

Manage windows #

ActionLinux and WindowsmacOSMenu
New windowCtrlShiftN⌥⌘NFile ▸ New Window
Open a window from the libraryNo default keyNo default keyFile ▸ Open Window
Rename the windowNo default keyNo default keyFile ▸ Rename Window…
Delete the windowNo default keyNo default keyFile ▸ Delete Window
Previous window, next windowNo default keyNo default keyNavigate ▸ Previous Window, Next Window
Full screenF11⌃⌘FView ▸ Toggle Full Screen
Show or hide the sidebarCtrlShiftS⌃⌘SView ▸ Hide Sidebar

File ▸ Open Window lists all windows of the library. A check mark shows the open windows. Select a closed window to open it. The command palette also has a row Open Window: for each closed window.

Delete Window asks for a confirmation when the window has sessions. You cannot delete the last window.

Close a window #

To close a window, click the close button of the window. If the window has sessions, ngterm asks for a confirmation. ngterm keeps the window and its layout in the library. To open it again, use File ▸ Open Window. In Live sessions mode, its programs continue to run, and the window attaches to them again. In the other modes, its sessions start new shells.

When you close the last open window, ngterm quits. When the window has no session, the close key closes the window.

Sessions and windows #

Each session belongs to one window. You cannot move a session to another window. To make a session in a specified window from a script, use ngtermctl session new --window (see ngtermctl reference).

Windows after a restart #

ngterm opens the windows that were open when you quit. It restores their size. Where the desktop lets an app set the position of a window, ngterm also restores the position.

The title bar #

The title bar shows the session name. A second line under it shows the terminal title or the folder of the session. Above the sidebar, the title bar has the sidebar search field and the sidebar button. The other buttons are at the right:

ButtonWhat it does
Recent sessions (clock)Lists the sessions that you used most recently.
Attention (bell)Lists the sessions with an agent status in all windows. Off by default. To show it, set Settings ▸ Notifications ▸ Show attention indicator to on.
Scratch terminalShows or hides the scratch terminal.
Split viewShows or hides the split.
Hide overlaysHides or shows the overlays of the session. Off by default.
DashboardOpens the dashboard.
Quick terminalShows or hides the quick terminal.
Custom commandsLists your custom commands. Off by default.
Main MenuOpens the menus.

Settings ▸ Interface ▸ Title Bar sets which buttons and names show. For example, Workspace name and Window name add these names to the title bar. Settings ▸ Appearance ▸ Toolbar sets the size of the title bar: Normal, Compact or Hidden. The Hidden mode keeps only a thin bar with the main menu button and the window controls.

On Linux, double-click the title bar to maximize the window or to restore it. Drag the title bar to move the window. On Windows, ngterm draws its own title bar with the minimize, maximize and close buttons.

Remote windows #

A remote window shows the sidebar of a computer that runs ngterm without a screen. To open one, select File ▸ Open Remote Window…. See Remote machines.

Quit #

To quit ngterm, select Main Menu ▸ Quit on Linux and Windows. On macOS, push ⌘Q. While windows are open, ngterm asks for a confirmation first.

With Live sessions, the programs in your sessions continue to run after the quit. The menu then also has Reset Live Sessions…. This item stops the live sessions that must start again, then starts ngterm again. See Manage live sessions.

Agent status #

ngterm shows the state of a coding agent on the row of its session in the sidebar. The agent sends its state to ngterm through hooks, extensions or plugins. ngterm does not read the terminal text to find the state.

The same status also shows in the dashboard, in the attention list and on the attention bell in the title bar. The phone and tablet apps show it too (see Phone and tablet apps).

Statuses #

StatusDefault glyphMeaningWhen it clears
activeA light gray circle that pulsesThe agent works on a turn.You push Esc or CtrlC in the pane, or the agent sends a new status.
blockedAn orange circleThe agent waits for you, for example at a permission prompt or with a question.You type in the pane (see Status reset below), or the agent sends a new status.
completedA green circleThe agent finished its turn.You type in the pane, or the agent sends a new status. If the status has auto-reset, a visit to the session also clears it. The agent hooks of ngterm set auto-reset.
idleNo glyphNo agent works in the session.Not applicable.

A session with the status blocked or completed is an attention session. If you set Settings ▸ Agent Status ▸ Attention navigation includes active sessions to on, the attention steps also stop at active sessions.

To clear a status by hand, right-click the session row and select Clear Status. To mark an idle session, right-click its row and select Mark for Attention. This sets the status to completed without auto-reset, so a visit to the session does not clear it.

Supported agents #

AgentHow it reportsStatuses it sendsFile that the installer writes
Claude CodeHooksactive, blocked, completed~/.claude/settings.json
CodexLifecycle hooksactive, blocked, completedconfig.toml in $CODEX_HOME, by default ~/.codex/config.toml
PiExtensionactive, completed~/.pi/agent/extensions/ngterm-status.ts
Oh My Pi (omp)Extensionactive, completed~/.omp/agent/extensions/ngterm-status.ts
OpenCode 1Pluginactive, blocked, completed~/.config/opencode/plugins/ngterm-status.js
OpenCode 2Pluginactive, blocked, completedplugins/ngterm-v2/tui.js in the OpenCode 2 configuration folder
Gemini CLI, Cursor Agent, Aider, Crush, GooseShell integrationactive while the command runs~/.zshrc, ~/.bashrc and, if fish is set up, ~/.config/fish/config.fish

The shell integration matches the command that you type: gemini, cursor-agent, aider, crush or goose. It sets active when the command starts and idle at the next prompt. It works in bash, zsh and fish. It does not work in PowerShell.

The hooks package goes to ~/.config/ngterm/agent-status. On Windows, this is %USERPROFILE%\.config\ngterm\agent-status. All hooks, extensions and plugins call the scripts in this folder.

Install the hooks and the agent skill #

On the first start, ngterm offers to install the agent skill and the agent status hooks. You can also install them at any time from the Help menu.

  1. Select Help ▸ Install Agent Status Hooks….
  2. If ngterm can not find the OpenCode version, select the version in the Choose OpenCode Version dialog.
  3. Read the result dialog. It shows the result for each agent.
  4. If you use Codex, start Codex and type /hooks.
  5. Review the ngterm hooks in Codex and approve them.
  6. If you use Pi, restart Pi or type /reload.
  7. If you use Oh My Pi or OpenCode, restart it.
  8. Open a new session. The shell integration starts only in a new shell.
  9. Start the agent again. An agent that runs now does not load the new hooks.

The installer writes the files of Codex, Pi, Oh My Pi and OpenCode only if it finds their configuration folders. Start each of these agents one time before you install.

You can run the installer again at any time. A second run changes only what is out of date. Before it changes settings.json or config.toml, it makes a backup copy with the .bak extension.

If a configuration file is not valid or has an unknown structure, the installer does not change it. The result dialog then shows a warning. Correct the file and run the installer again, or add the hooks by hand.

To install the agent skill, select Help ▸ Install Agent Skill…. See The agent skill.

What the Claude Code hooks do #

The installer adds these hooks to ~/.claude/settings.json:

The hooks report only for the interactive Claude Code of the pane. A subagent or a claude -p worker that another agent starts in the same pane does not change the status of the pane.

Per-agent notes #

AgentNote
Claude CodeOn Windows, the hooks run the PowerShell form of the scripts through powershell.exe. Windows PowerShell 5.1 is sufficient.
CodexCodex runs a new hook only after you approve it with /hooks.
CodexCodex sets blocked only when an approval prompt stays on the screen, or when the last answer asks you a question. An automatic review that approves a tool does not set blocked.
CodexThe shell integration starts each Codex TUI with --no-daemon, so that each pane reports its own status. To keep the shared daemon, run command codex or set NGTERM_CODEX_KEEP_DAEMON to a value.
CodexOn Windows, the hooks run in Git Bash from %ProgramFiles%\Git\bin\bash.exe. Install Git for Windows first. Approval prompts of Codex do not set blocked on Windows.
CodexIf CODEX_HOME points to a different folder, the installer writes there.
PiPi has no blocked status.
Oh My PiOnly the top-level session reports. The status stays active while Oh My Pi continues a turn or runs background work.
OpenCodeOpenCode 2 reads its configuration folder from OPENCODE_CONFIG_DIR. The installer finds it from your login shell.
Shell integrationTo change the list of commands, set NGTERM_AGENT_RE to a regular expression before the integration loads.

Add Claude Code hooks by hand #

Use this procedure only if the installer can not change your settings.json. This procedure adds only the status hooks. The restore, mail and chat hooks come only from the installer.

  1. Run Help ▸ Install Agent Status Hooks… one time, so that the scripts are in ~/.config/ngterm/agent-status.
  2. Open ~/.claude/settings.json in an editor.
  3. Add one entry for each event in the table below.
  4. Start Claude Code again.
EventMatcherArguments to ngterm-claude-status.sh
UserPromptSubmitnoneactive --blink
PostToolUsenoneactive --blink
Stopnonecompleted --auto-reset
PermissionRequestnoneblocked
Notificationpermission_promptblocked
SessionEndnonecompleted --auto-reset

Each entry has this form. Replace /home/you with your home folder:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "permission_prompt",
        "hooks": [
          {
            "type": "command",
            "command": "'/home/you/.config/ngterm/agent-status/ngterm-claude-status.sh' blocked"
          }
        ]
      }
    ]
  }
}

On Windows, the command runs the PowerShell form of the script:

"command": "powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File \"C:/Users/you/.config/ngterm/agent-status/ngterm-claude-status.ps1\" blocked"

Add Codex hooks by hand #

The installer does not change a config.toml that already has its own hooks, or that is not valid TOML. In that case, add the ngterm hooks yourself.

  1. Run Help ▸ Install Agent Status Hooks… one time, so that the scripts are in ~/.config/ngterm/agent-status.
  2. Open config.toml in $CODEX_HOME, by default ~/.codex/config.toml.
  3. Add the block below at the end of the file. Replace /home/you with your home folder.
  4. Start Codex and type /hooks.
  5. Review the ngterm hooks and approve them.
# >>> ngterm agent-status >>>
[[hooks.SessionStart]]
[[hooks.SessionStart.hooks]]
type = "command"
command = "'/home/you/.config/ngterm/agent-status/ngterm-codex-status.sh' session-start"

[[hooks.UserPromptSubmit]]
[[hooks.UserPromptSubmit.hooks]]
type = "command"
command = "'/home/you/.config/ngterm/agent-status/ngterm-codex-status.sh' user-prompt-submit"

[[hooks.PreToolUse]]
[[hooks.PreToolUse.hooks]]
type = "command"
command = "'/home/you/.config/ngterm/agent-status/ngterm-codex-status.sh' pre-tool-use"

[[hooks.PostToolUse]]
[[hooks.PostToolUse.hooks]]
type = "command"
command = "'/home/you/.config/ngterm/agent-status/ngterm-codex-status.sh' post-tool-use"

[[hooks.PermissionRequest]]
[[hooks.PermissionRequest.hooks]]
type = "command"
command = "'/home/you/.config/ngterm/agent-status/ngterm-codex-status.sh' permission-request"

[[hooks.Stop]]
[[hooks.Stop.hooks]]
type = "command"
command = "'/home/you/.config/ngterm/agent-status/ngterm-codex-status.sh' stop"
# <<< ngterm agent-status <<<

Keep the two marker lines. With the markers, a later run of the installer can update the block.

On Windows, give each hook a command_windows line that runs the script in Git Bash. For example, for stop:

command_windows = "\"%ProgramFiles%\\Git\\bin\\bash.exe\" \"C:/Users/you/.config/ngterm/agent-status/ngterm-codex-status.sh\" stop"

Add hooks to another agent #

Any agent with hooks can report a status. Make its hooks run the generic wrapper with a status:

~/.config/ngterm/agent-status/ngterm-agent-status.sh active --blink     # the agent works
~/.config/ngterm/agent-status/ngterm-agent-status.sh blocked            # the agent waits for you
~/.config/ngterm/agent-status/ngterm-agent-status.sh completed --auto-reset
~/.config/ngterm/agent-status/ngterm-agent-status.sh idle               # clear the status

The wrapper finds the session and the pane from the NGTERM_* variables of the shell. Outside ngterm, it does nothing. It always exits with status 0, so it can not stop the agent. On Windows, run ngterm-agent-status.ps1 with powershell -NoProfile -ExecutionPolicy Bypass -File.

A script can also set the status directly with ngtermctl session status. See ngtermctl reference.

Option of session statusEffect
--blinkThe glyph pulses.
--auto-resetThe status changes to idle when you visit the session.
--if-idleThe status changes only if the session is idle now.
--sound NAMEA sound plays when the status is set. default plays the system alert sound.
--color #rrggbbA different glyph color, for this status only.
--shape NAMEA different glyph shape, for this status only: circle, square, triangle, triangle-down, play, diamond, capsule, seal, star, bolt, bell or checkmark.
--pane left, right or scratchThe pane that set the status. Navigation to the session then opens this pane.

To wait for an agent in a script, use ngtermctl session wait:

ngtermctl session wait --target "$id" --until completed --until blocked --timeout 3600

Go to attention sessions #

ActionLinux and WindowsmacOS
Show the list of attention sessions (Go to Attention…)CtrlShiftI⌃⇧I
Go to the next attention sessionAltShift↓⌃⌥↓
Go to the previous attention sessionAltShift↑⌃⌥↑

These commands are also in the Navigate menu. A script can do the same step with ngtermctl session go --to next-attention. See also Navigation.

Agent status settings #

These settings are in Settings ▸ Agent Status.

SettingDefaultWhat it does
Active, Blocked, CompletedGray, orange, green circlesThe color and the shape of the glyph for each status.
Blocked soundNoneA sound that plays when a session becomes blocked. On Linux, each sound name plays the alert sound of the desktop.
Status resetOn first keyThe key in the pane that clears a blocked or completed status: On first key, On Enter or Disabled.
Attention navigation includes active sessionsOffThe attention keys also stop on active sessions.
Attention navigation crosses windowsOffThe attention keys go to sessions in all open windows.
Auto-follow blocked sessionsDisabledAfter you do nothing for the given time (5 seconds to 5 minutes), the window selects the oldest blocked session.
Auto-follow away from a running sessionOnAuto-follow also leaves a session whose agent is active.
Reset to defaultsNot applicableSets the glyph colors and shapes, Blocked sound and Status reset back to their default values.

Notifications #

A notification tells you about an event in a session. It has three parts:

The banner uses the native notification system of each platform:

PlatformBanner
LinuxThe freedesktop notification server of the desktop (org.freedesktop.Notifications)
WindowsA Windows toast notification
macOSThe macOS notification center

Where notifications come from #

ngterm ignores a notification from a pane while that pane has the keyboard focus and ngterm is the active app. No banner shows, and the badge does not change.

To send a notification from a program, write the escape sequence to the terminal:

printf '\e]9;%s\e\\' "The tests passed"                    # OSC 9: a body only
printf '\e]777;notify;%s;%s\e\\' "Tests" "The tests passed"  # OSC 777: a title and a body

What a banner does #

The badge clears when you visit the session or type in it. Settings ▸ Notifications ▸ Badge reset sets which key clears it. A script can clear it with ngtermctl session seen.

Send a notification with ngtermctl #

ngtermctl notify [--title TITLE] [--target SESSION] [--window WINDOW] BODY
PartMeaning
BODYThe text of the notification. It is necessary.
--titleThe title. The default is the name of the session.
--targetThe session that the notification belongs to. The default is active, the selected session of the front window.
--windowThe window that holds the session. The default is the front window.

An agent must give its own session as the target. Else the notification goes to the session that you selected:

ngtermctl notify --target "$NGTERM_SESSION_ID" --title "Build" "The build is done"

If Show notification banners is off, the command still adds to the badge. It then prints a note that no banner was posted.

For an agent that waits for you, use the agent status, not a notification. A status stays on the row until you act on it, and the attention keys find it. A notification is a single message with no state. See Agent status.

To run your own command when a notification comes, use the notify event in hooks.conf. See Event hooks.

Notification settings #

These settings are in Settings ▸ Notifications.

SettingDefaultWhat it does
Show notification bannersOnPosts a banner for each notification.
Show notification badgesOnShows the count of unseen notifications on the session row. When it is off, ngterm still counts them.
Badge resetOn first keyThe key in the session that clears the badge: On first key, On Enter or Disabled. A visit to the session always clears it.
Notification soundNoneA sound that plays with the banners. On Linux, each sound name plays the alert sound of the desktop. On Windows, the toasts are silent and ngterm plays the sound itself.
Show attention indicatorOffShows a bell button in the title bar. The bell has a color while a session is blocked. Click it to see the attention sessions.

Pages and viewers #

A page is a web view that ngterm shows in a session. A page can show an HTML file, a web address, a Markdown file, an image, or a text file. You open a page from the terminal with a click, or with ngtermctl session overlay open.

Kinds of pages #

KindOpen it withWhat it showsPage scriptsPage bridge
HTML file--html FILEA local HTML fileOnly with --jsYes
Web address--url URLAn http or https addressOnly with --jsNo
Markdown--markdown FILEA .md or .markdown file, rendered in the terminal themeNoNo
Image--image FILEA png, jpg, gif or webp imageNoNo
Text--text FILEA source, configuration, text or log file with line numbersNoNo
Clicked HTML fileA click on a .html or .htm pathA static copy of the fileNoNo

The page bridge lets a page send commands to ngterm. See The page bridge.

Open a file from the terminal #

Many programs print file paths and links. Click them to open them in ngterm:

ActionLinux and WindowsmacOS
Open a link or a file pathCtrl + click⌘ + click
Open it while the program uses the mouseCtrlShift + click⇧⌘ + click
Open a web link in the browser, not in an overlayCtrlShift + click⇧⌘ + click
Show a local path in the file managerCtrlAlt + click⌥⌘ + click
Show a local path in the file manager while the program uses the mouseCtrlAltShift + click⌥⇧⌘ + click

What a click on a local path opens:

PathResult
.png, .jpg, .jpeg, .gif, .webpAn image page
.md, .markdownA Markdown page that follows links to the Markdown files next to it
.html, .htmA static HTML page, with no scripts, no file access and no network
.log, .outA log page that follows the end of the file
.diff, .patchA diff page
path:line or path:line:columnA text page at that line
Other source, configuration and text filesA text page
Other filesngterm shows the file in the file manager. It does not run the file.

ngterm looks for a relative path in the current folder of the pane. A clicked page opens at the size that Settings ▸ General ▸ Open links in sets, or at 95% if links open in the browser.

The Open links in setting also sets where a web link goes: Browser, Session overlay, or a session overlay at 95%, 75% or 50%. In an overlay, a plain http link opens only for a local host, for example localhost, a .local name or an IP address. The command ngtermctl browser links reads and changes the same setting.

In a session attached from another machine, a click opens the page from that machine. Both machines must run a version of ngterm that sends clicks. See Remote machines.

Where a page opens #

PlacementOptionResult
Session overlaynoneThe page covers the whole session.
Floating panel--size-percent NA framed panel at N percent of the session. Add --width and --height to set sizes in points.
One pane--pane left or --pane rightThe page covers one pane of a split. The other pane stays usable.
Page companion--companionA new sidebar row under the target session shows the page.
Page session--pageA new top-level sidebar row shows the page.

Each session has one overlay slot, and each pane of a split has its own slot. If the slot already holds a page or a program, ngterm refuses a new page with overlay already open. A page companion and a page session never start a shell.

Add --follow to select the session after the page opens. Without --follow, the selection does not change.

Keys for the overlays of a session:

ActionLinux and WindowsmacOS
Hide or show the overlaysCtrlAltShiftJ⇧⌘J
Close the pageCtrlShiftQ⌘W

A hidden page continues to run. The same command is in the View menu as Hide Overlays or Show Overlays. You can also close a page with the close button on its strip, or with ngtermctl session overlay close.

A page stays open until you close it. When ngterm starts again, each page comes back in its slot. ngterm loads the page again from its source, so the state inside the page is lost. Page companions and page sessions come back in every restore mode.

HTML pages #

Use an HTML page to show a report, a chart or a prototype:

ngtermctl session overlay open --html /tmp/report.html --target "$NGTERM_SESSION_ID" --follow
ngtermctl session overlay reload --target "$NGTERM_SESSION_ID"   # after you change the file
OptionEffect
--jsLets the page run its own JavaScript. By default, page scripts are off.
--cwd DIRLets the page read the files in DIR. The HTML file must be in DIR. ngterm refuses / and the home folder.
--navigationAdds Back, Forward, Reload, Open in Browser and Show in Files to the strip.
--chromelessRemoves the strip. The page fills its panel. You can not use it with --navigation.
--blockThe command waits until the page gives an answer or closes. See The page bridge.
--background-color #rrggbbSets the background behind the page.

Without --cwd, the page has no access to files. Keep such a page self-contained: inline CSS, inline SVG and data: URLs. Images and stylesheets from the network load.

The strip at the top of the page shows the file name or the site, the page title and a close button.

A page can not open popups, script dialogs or file choosers. ngterm refuses files that you drop or paste onto a page, and requests for the camera or the microphone. If you click a link to a web address, ngterm asks you first. It then opens the link in your browser.

Web pages #

Use a web page to show a development server or a documentation site:

ngtermctl session overlay open --url http://localhost:5173/ --js --target "$NGTERM_SESSION_ID" --follow
OptionEffect
--jsLets the page run its JavaScript. Most web apps must have it.
--persistentKeeps cookies and site data in one saved store. A login then stays after you close the page or restart ngterm.
--browseLets the page go to other sites. Without it, the page stays on its first site.
--navigationAdds Back, Forward, Reload, Open in Browser and Copy Link to the strip.
--chromelessRemoves the strip. ngterm accepts it only for 127.0.0.1, ::1 and localhost.

The address must be reachable from the computer that runs ngterm. Use https for public hosts. Plain http works for local addresses.

A link to the same site loads in the page. A link to a different site opens in your browser after you confirm. A login that goes to a different site, for example a single sign-on page, works only with --browse. A login in a popup does not work.

Without --persistent, each page has its own storage, and the storage goes away when the page closes. To delete the saved store, close all persistent pages and run ngtermctl browser clear.

Markdown pages #

ngtermctl session overlay open --markdown docs/plan.md --navigation --size-percent 95 --target "$NGTERM_SESSION_ID"

A Markdown page shows code with syntax colors, task lists and heading anchors. Images in the folder of the file show. Other images show their alternative text, and ngterm does not load them. Raw HTML in the file stays as text.

With --navigation, a link to a Markdown file in the same folder or below opens in the same page. Use Back and Forward on the strip to go between the files. A web link opens in your browser after you confirm. A Markdown page opened with a click always follows its links.

Text, log and diff pages #

ngtermctl session overlay open --text src/main.rs --line 42 --target "$NGTERM_SESSION_ID"
ngtermctl session overlay open --text app.log --follow-file --target "$NGTERM_SESSION_ID"
OptionEffect
--line NOpens the file at line N and marks the line.
--tail NShows only the last N lines (1 to 100,000). This makes a log page.
--follow-fileFollows the end of the file as it grows. It shows the last 5,000 lines if you do not give --tail.

A text page shows syntax colors for known languages, for files up to 256 KB. A larger file shows as plain text. ngterm refuses a text file larger than 4 MB, but a log page reads only the end of the file. The page runs nothing and has no links.

A log page has a bar with a follow button and a search field. Scroll up to pause it. Scroll to the bottom, or click Resume, to follow again. If the file is rotated or made again, the page reads the new file. If the file is not there, the page waits for it.

To show changes, write each diff to its own .diff file and print the paths. Then open a path with a click, as Open a file from the terminal tells.

Keys in a text, log or diff page:

KeyAction
/, or CtrlShiftF on Linux and Windows, or ⌘F on macOSGo to the search field
n and NGo to the next and the previous match
EscClear the search
wWrap or unwrap long lines
FFollow or pause a log page
G or EndGo to the bottom of a log page and follow it
g or HomeGo to the top of a log page
] and [Go to the next and the previous change in a diff page

A script can do the same with ngtermctl session overlay search, wrap, follow and changes.

Image pages #

ngtermctl session overlay open --image /tmp/screenshot.png --target "$NGTERM_SESSION_ID"

Without a size, the panel takes the shape of the image, up to 80% of the session. ngterm refuses a file larger than 64 MB or an image larger than 100 megapixels.

Theme colors in a page #

Each page receives the colors of the terminal theme as CSS variables:

VariableValue
--ngterm-backgroundThe background color of the overlay
--ngterm-foregroundThe text color of the theme
--ngterm-color-0 to --ngterm-color-15The 16 ANSI colors of the theme. 1 is red, 2 green, 3 yellow, 4 blue, 5 magenta, 6 cyan. 8 to 15 are the bright forms.

Use the variables with a fallback value. Do not declare --ngterm-* variables in your page, because your value replaces the theme value.

body { background: var(--ngterm-background, Canvas); color: var(--ngterm-foreground, CanvasText); }
.ok  { color: var(--ngterm-color-2, green); }

An HTML file page with no styles of its own takes the theme background and text color. When the theme changes, ngterm loads a file page again. A web page keeps the browser styles and receives the new colors at its next load.

Web engine #

PlatformWeb engine
LinuxWPE WebKit. ngterm uses the WPE WebKit of your distribution if it is recent enough. Else, ngterm downloads the engine the first time that you open a page.
WindowsMicrosoft Edge WebView2
macOSWebKit (WKWebView)

On Linux, if the download fails, install WPE WebKit from the packages of your distribution. You can also run ngterm --install-web-engine ARCHIVE with the archive of the engine.

On Ubuntu 23.10 and later, AppArmor blocks the web engine sandbox until the ngterm AppArmor profile is installed. The .deb package installs the profile. For an AppImage or a tarball, follow the steps in WebKit sandbox on Ubuntu.

The page bridge #

An HTML file page can send commands to ngterm. With these commands, a page can switch sessions, rename them, set a status, or give a choice back to the script that opened it. The commands are the same as the commands of the control socket that ngtermctl uses.

A page sends commands in two ways:

Which pages have the bridge #

Pagedata-ngterm controlsngterm.request()
--html FILEYesNo
--html FILE --jsYesYes
--html FILE as a page companion or page sessionYesOnly with --js
--url URLNoNo
--markdown, --text, --imageNoNo
A clicked .html or .htm fileNoNo

ngterm refuses requests from a frame inside the page. It also refuses these commands from any page: live.present, live.reset, session.overlay.job.run and session.overlay.page.serve.

Tagged buttons and forms #

AttributePut it onMeaning
data-ngterm="COMMAND"A button or a formThe command to send, by its socket name, for example session.select.
data-ngterm-target="ID"The same elementThe target: a session, workspace or window id, a unique prefix of an id, or active.
data-ngterm-args='{...}'The same elementA JSON object with fixed arguments of the command.
data-ngterm-into="SELECTOR"The same elementAn element that shows the answer: result.text, else the result as JSON, or the error.

In a tagged form, each named control adds an argument with its name. Its value overrides the same key in data-ngterm-args.

ControlValue that it sends
<input type="number">A number. An empty field sends nothing.
<input type="checkbox">true or false
<input type="radio">The value of the selected radio button
The submit button that you click, if it has a nameIts value, as text
All other controlsTheir value, as text

ngterm skips controls with the disabled attribute. It refuses a file input, and a name that has two values. A tagged button outside a form must have type="button".

<button type="button" data-ngterm="session.select" data-ngterm-target="3F2A">api</button>
<form data-ngterm="session.rename" data-ngterm-into="#answer">
  <input name="name"><button>Rename</button>
</form>
<button type="button" data-ngterm="session.status" data-ngterm-args='{"status":"completed"}'>Done</button>
<button type="button" data-ngterm="session.overlay.close">Close</button>
<p id="answer"></p>

The JavaScript API #

A page that you open with --js has a global object ngterm. The page can not change or replace it.

MemberFormResult
ngterm.requestngterm.request(command, {target, args})A Promise. It resolves with the result object of the command, or {} if the command has no result. It rejects with an Error that holds the error text of ngterm.
ParameterTypeMeaning
commandstringThe socket name of the command, for example tree, session.select or notify.
targetstring, optionalA session, workspace or window id, a unique prefix of an id, or active.
argsobject, optionalThe arguments of the command, by their socket names, for example {name: "api"}.

The second parameter holds target and args. It is not the arguments object itself.

A --js page can also close its own overlay with window.close(). The web view can refuse this, for example after a call to history.pushState. Then use session.overlay.close.

This page shows the sessions of its window as buttons. A click selects the session:

<!doctype html>
<title>Sessions</title>
<ul id="rows"></ul>
<button type="button" id="refresh">Refresh</button>
<script>
  async function draw() {
    const {tree} = await ngterm.request('tree');
    const rows = document.getElementById('rows');
    rows.replaceChildren();
    for (const workspace of tree.workspaces) {
      for (const session of workspace.sessions) {
        const button = document.createElement('button');
        button.type = 'button';
        button.textContent = session.name;
        button.onclick = () => ngterm.request('session.select', {target: session.id});
        const row = document.createElement('li');
        row.append(button);
        rows.append(row);
      }
    }
  }
  document.getElementById('refresh').onclick = draw;
  draw().catch((error) => { document.body.append(error.message); });
</script>
ngtermctl session overlay open --html sessions.html --js --size-percent 60 --target "$NGTERM_SESSION_ID" --follow

Default targets #

If a request has no target, no batch and no window, ngterm fills them from the place of the page now:

CommandActs on
session.* commands, but not session.new and session.goThe session of the page
notify, font.inc, font.dec, font.reset, keymap.runThe session of the page
ask.open in the terminal styleThe session of the page
The overlay commands of the page: session.overlay.close, reload, resize, navigate, submit, hide, show, toggle, follow, search, changes and wrapThe page itself, in its own pane
window.close, select, rename, delete, resize, move, zoom, fullscreen, minimizeThe window of the page
hooks.reload, hooks.list, browser.clear, browser.links, recent.list, recent.clearThe whole app
live.attach, live.attach.group, dashboard, recent.openTheir own ids, in the window of the page
All other commands, for example treeThe window of the page

session.overlay.reload from a page loads the page that it shows now, not its first address. An explicit target, active, window or batch is used as given.

A page session or a page companion has no terminal. ngterm refuses terminal commands for it, for example session.type and session.split.

If the page shows a session from another machine, its commands go to that machine. See Remote machines.

Give a choice back to a script #

A page can be a dialog with a richer layout than ngtermctl pick. Open the page with --block, and give it session.overlay.submit controls. The value goes back to the command that opened the page, and the page closes.

choice=$(ngtermctl session overlay open --html /tmp/branches.html --block --target "$NGTERM_SESSION_ID" --follow)
<button type="button" data-ngterm="session.overlay.submit" data-ngterm-args='{"value":"main"}'>main</button>
<button type="button" data-ngterm="session.overlay.submit" data-ngterm-args='{"value":"dev"}'>dev</button>
Exit statusOutputMeaning
0{"pageID":"…","outcome":"submitted","value":"main"}The page sent a value. An empty value is a valid answer.
2{"pageID":"…","outcome":"dismissed"}The page closed with no answer.
1An errorThe page did not open, or another error occurred.

To read the answer later, use ngtermctl session overlay result --page ID with the pageID that the open command returned. A script can also answer for the page with ngtermctl session overlay submit --value TEXT.

A --js page in a floating panel can fit the panel to its content. It sends session.overlay.resize with a height in points. Read the page zoom from htmlOverlays[].zoom in ngtermctl tree --json to convert CSS pixels to points.

Restore and Live sessions #

When ngterm starts, it brings back your windows, workspaces and sessions. Settings ▸ General ▸ Restore sessions sets what happens to the programs in them. The setting applies to all sessions. A change applies after you restart ngterm.

Restore modes #

ModeWhat comes back
Fresh shells (default)The windows, workspaces, sessions, folders and split layout, with new shells.
Re-run commandsThe same as Fresh shells. Each pane also starts again the command that ran in it when you quit. The old process does not come back.
Live sessionsThe same processes. Each pane runs in a live session that continues to run when ngterm quits. The next start attaches to it again.

In all modes, the overlays that run programs and the quick terminal do not come back. The scratch terminal comes back only in Live sessions mode. Pages, page companions and page sessions come back in all modes.

To change the mode:

  1. Open Settings ▸ General.
  2. Set Restore sessions to the mode.
  3. Quit ngterm and start it again.

A script can read and set the mode with ngtermctl restore mode. The command ngtermctl restore mode without a value shows the mode of this start and the mode for the next start.

Live sessions #

With Live sessions, you can quit, update or restart ngterm while your programs continue to run. An agent in the middle of a task continues its work. When ngterm starts again, each pane attaches to its process again.

Live sessions work with these shells:

PlatformShells
Linux and macOSzsh, bash, fish and PowerShell. Live sessions use your login shell, or the shell that the Ghostty command setting names.
WindowsPowerShell 7 (pwsh.exe), Windows PowerShell and Git Bash. Command Prompt and WSL profiles also run in live sessions.

If ngterm can not use Live sessions, Settings ▸ General shows the reason below the setting. A shell profile with startup arguments that Live sessions can not use opens a normal shell.

After the attach, the text, the state of full-screen programs, the colors and the links on the screen come back. These do not come back:

New output after the attach works normally.

The primary pane, the split pane and the scratch terminal of each session are live. The overlays that run programs and the quick terminal are not.

What survives a quit, an update or a restart #

EventFresh shellsRe-run commandsLive sessions
You quit ngtermNew shellsThe commands start againThe same processes come back
You update ngtermNew shellsThe commands start againThe same processes come back
ngterm crashes, or you force it to quitNew shellsNew shells, or the commands of the last ngtermctl restore captureThe same processes come back
An orderly restart of the computerNew shellsThe commands start againEach pane starts its last command again in a new live shell
A power lossNew shellsNew shells, or the commands of the last ngtermctl restore captureNew shells

To update ngterm with Live sessions on:

  1. Install the new version.
  2. Quit ngterm.
  3. Start ngterm again.

The panes attach to the same processes. ngtermctl version shows an installed: line when the installed version is different from the version that runs.

When you quit ngterm, it records the foreground command of each live pane. If a live session is gone after a restart of the computer, the pane starts this command again in a new live shell. The pane starts a plain new shell in these cases:

When ngterm receives SIGTERM, it quits without a prompt. The live sessions continue to run. ngterm records the commands, as at a normal quit.

When you close a window in Live sessions mode, its sessions continue to run. Open the window again from File ▸ Open Window. In the other modes, a window close ends the programs of its sessions.

When you delete a session or a split, ngterm ends its live session after the undo time.

If you change from Live sessions to another mode and restart, ngterm ends all detached live sessions. If you change to Live sessions, the current shells end at the next quit. The first start in Live sessions mode starts the recorded commands again where possible.

Re-run commands #

When you quit, ngterm records the command that runs in the foreground of each pane. At the next start, it types that command in a new shell.

restore-denylist.conf in the configuration folder lists the programs that ngterm does not start again. Write one command name on each line. Lines that start with # are comments. ngterm reads the file when it starts. By default, the list holds tmux, screen and zellij, because they start an empty session.

CommandWhat it does
ngtermctl restore captureRecords the commands of all panes now. Use it from a scheduled job, so that a crash or a power loss restores the commands. It works only in Re-run commands mode.
ngtermctl restore clearDeletes all recorded commands. The next start opens plain shells.
ngtermctl session restore COMMANDPins the command that one pane starts at each restart. --none pins no command, and --clear removes the pin.

The Claude Code hooks pin each pane to its current conversation. At the next start, the pane runs claude --resume with that conversation, or a new claude if the conversation can not continue. If you exit Claude Code yourself, the hook removes the pin.

Manage live sessions #

CommandWhat it does
ngtermctl live listLists all live sessions and the panes that expect them.
ngtermctl live screen NAMEPrints the screen of one live session, also for a pane in a closed window.
ngtermctl live pruneEnds the live sessions that no pane claims and that have no attached client.
ngtermctl live kill --target ID --pane left --forceEnds the live session of one pane and its process.
ngtermctl live reset --forceDoes the same as Reset Live Sessions… without the dialog.

Reset Live Sessions… is in the main menu while Live sessions mode is on. It ends the live sessions of these panes:

Live sessions that are current and supervised continue to run. Before you confirm, the dialog tells you how many live sessions the reset ends. Then ngterm quits, starts again, and creates the ended sessions again with their recorded commands. Use the reset only if a live session misses a change of a new version. Use the dialog when you can. ngtermctl live reset --force does not ask for a confirmation and does not tell you which sessions it ends.

Remote machines #

ngterm can show sessions that run on a different computer. The programs stay on that computer, and ngterm shows them through ssh. You can use a remote machine in two ways:

The two ways use the same list of machines, remotes.conf, and the same ssh setup.

Before you start #

Each remote machine must have these items:

Your own computer uses the ssh program on its PATH. On Windows, this is the Windows OpenSSH client by default.

The remotes.conf file #

remotes.conf is in the config folder, beside keymap.conf (refer to Files and folders). Write one machine on each line: the ssh destination, then an optional label. A line that starts with # is a comment.

# destination        label
me@buildbox          Build server
studio.local         Mac studio
agterm:old-mac       Old Mac (agterm only)
connect-timeout = 20
connect-timeout me@buildbox = 45
LineWhat it does
DESTINATION [LABEL]Adds a machine. The destination is what you give to ssh: a host, user@host or a ~/.ssh/config alias. The label shows in the picker. Without a label, the picker shows the destination.
agterm:HOST or ngterm:HOSTAdds a machine and lists the sessions of one app only, on a Mac that runs both ngterm and agterm. ssh receives only HOST.
connect-timeout = SECONDSSets how long ssh can try to reach every machine. The default is 10 seconds. The range is 1 to 300 seconds.
connect-timeout DESTINATION = SECONDSSets the connection timeout for one machine. This value wins over the value for every machine.

ngterm reads the file again when you save it. A bad line shows a Remotes banner, and ngterm skips that line.

Attach a remote session #

  1. Add the machine to remotes.conf.
  2. Select File ▸ Attach Remote…, or push CtrlShiftR (⇧⌘R on macOS).
  3. If remotes.conf has more than one machine, select the machine in the picker.
  4. Select a session in the list.

The session opens in the current workspace, with its split panes. A top-level session comes with its companion sessions. Two rows are at the top of the list:

RowWhat it does
Attach AllAttaches each session of the machine that is not attached yet. Companions go under their parent rows.
New SessionCreates a session on the remote machine, then attaches it here.

An attached row shows the status, name, context, info line, HUD and notifications of the remote session. The title bar shows the remote host. Commands that you type run on the remote machine. If you open a split pane on an attached row, ngterm creates the split on the remote machine.

The right-click menu of an attached row has two more items:

Some commands on an attached row run on the remote machine: session close --terminate, session restart, session restore and live kill. ngterm sends each request one time, through ngtermctl on that machine, and does not try again. If the reply does not come, the result is unknown, and ngterm does not show it as a refusal.

When you clear the status of an attached row, or you see its notification, the remote machine clears it too. The remote machine uses its own Status reset and Badge reset settings.

If you close an attached row, only the connection on your computer stops. The session continues to run on the remote machine. When you start ngterm again, it attaches the rows that were open at quit, when the machine answers.

To attach from a script, use ngtermctl live tree HOST and ngtermctl live attach HOST SESSION-ID. Refer to ngtermctl.

When the connection drops #

ngterm adds an ssh keepalive, so it finds a dead link in approximately 15 seconds. If your own ssh config sets ServerAliveInterval, ngterm uses your value.

A server without a display #

ngterm-headless is ngterm with no window. It keeps sessions on a machine that has no screen, for example a build server.

To install the server on a Linux machine (x86_64 or aarch64) with systemd, run this command on your desktop:

ngtermctl server install me@buildbox
OptionWhat it does
-p PORTUses this ssh port.
-i FILEUses this ssh identity file. You can give more than one.
-J HOSTConnects through this jump host.
-F FILEUses this ssh config file.
--from FILEInstalls a Linux release archive (ngterm-VERSION-linux-ARCH.tar.gz) that you downloaded before.

The command installs the ngterm-headless release of the same version as your ngtermctl, into ~/.local/lib/ngterm on the server. Before it sends the archive, it checks the archive against the checksums signed for that release. It sets up a systemd user service that continues to run after you log out. It also installs the agent skill and the agent status hooks on the server.

Exit codeMeaning
0The server is installed.
3The server is installed, but the agent hooks are not. The output tells the reason.
1The install failed. The output tells the reason.

The command turns on systemd lingering for your user, so that the server continues after you log out. If the server does not let you turn it on, the command stops and shows the command to give to an administrator. To upgrade the server after you update ngterm, run the same command again. The sessions continue to run.

On macOS, on Windows, or on Linux without systemd, install ngterm on the machine and start the server by hand:

ngterm-headless --detach
OptionWhat it does
--detachStarts the server in the background. The server continues to run after you log out.
--grid COLUMNSxROWSSets the start size of each terminal. The default is 80x24. An attached viewer sets its own size.
--install-agent-hooksInstalls or updates the agent skill and status hooks, then stops.
--skip-agent-setupStarts without a change to the agent skill and status hooks.
--opencode-version v1 or v2Sets the OpenCode version when ngterm cannot find it.

Each time the server starts, it installs or updates the agent skill and status hooks on that machine. Thus agents that run on the server report their status. After the server starts, wait some seconds. Then create a session to attach to:

ngtermctl session new --name build

Open a remote window #

  1. Add the server to remotes.conf.
  2. Select File ▸ Open Remote Window….
  3. If remotes.conf has more than one machine, select the server in the picker.

You can also run ngtermctl window remote open HOST. If a window for that host is open, ngterm brings it to the front.

The remote window shows the sidebar of the server: its workspaces, sessions, status, dialogs, pickers and pages. The sessions run on the server. Thus they continue when your computer sleeps or the network drops. The window connects again automatically, and a strip over the terminal area tells you that it waits.

When you close a session or a workspace in a remote window, ngterm asks what to do:

ButtonWhat it does
DetachHides the row on this computer only. The session continues on the server.
TerminateEnds the session on the server.
CancelDoes nothing.

To show a detached row again, select File ▸ Detached Sessions… in the remote window. A session that stopped on the server shows Ended on HOST.

The server keeps the history of a remote window. Open Recent, Reopen Last Closed Item and Reopen Closed Item use the list of the server, not the list of your computer. If Allow undo after closing sessions and workspaces is on and the server keeps this list, Terminate on a session gives the close an undo time, and the close question tells you so. Terminate on a workspace has no undo.

The server also keeps the flags and the tints of its sessions, so every desktop that shows the window sees them. An older server does not keep them, and they stay on your computer. Your computer saves its own view of the window: the backgrounds, the context text, the focused workspaces, the flagged order and the companion folds. They come back when you open the window again, and when you reattach a row.

A page session or a page companion that you open in a remote window is a page row on the server. Each desktop that shows the window shows the page. A page on the loopback address of the server (localhost) cannot be a page row, because no desktop can reach it. Open such a page over the session or in a pane.

Windows machines as hosts #

You can attach sessions from a Windows machine. The Windows machine must have these items:

To start the server again after a reboot, use Task Scheduler to run ngterm-headless --detach at logon.

agterm Macs #

You can attach sessions from a Mac that runs agterm in Live sessions mode. This works from every desktop and from the phone apps. ngterm finds out which app answers. The title bar marks these sessions agterm.

These sessions do not have these ngterm features:

If a Mac runs both apps, you see the sessions of both. To list one app only, write agterm:HOST or ngterm:HOST in remotes.conf. agterm lists only sessions that it started in Live sessions mode. If agterm uses a different mode, the picker tells you what to change on that Mac. To open a remote window on an agterm server, run ngtermctl window remote open agterm:HOST.

Terminfo on a remote machine #

ngterm sets TERM=xterm-ghostty. If you use ssh from a pane to a machine without this terminfo entry, programs such as less and vim can show a warning. To install the entry in your account on that machine, run:

ngtermctl terminfo install me@host

The command takes the same -p, -i, -J and -F options as server install. The remote machine must have tic (ncurses).

Phone and tablet apps #

The ngterm apps for Android and iOS connect over ssh to the machines that run ngterm. With them, you can watch and type into your sessions, start new sessions and answer your agents. The sessions run on the machine, not on the phone.

The machine must be ready for remote use: key-based ssh, ngtermctl on the PATH of ssh logins, and Live sessions or ngterm-headless. Refer to Remote machines.

Install the app #

PlatformRequirementsInstall
AndroidAndroid 8.0 or laterDownload the .apk from the Releases page. Let your browser or file manager install apps, then open the file.
iOS and iPadOSiOS 26 or later, iPhone or iPadDownload the unsigned .ipa from the Releases page. Sign it again with a sideloading tool or your own Xcode team, then install it.

Set up the ssh key #

At the first start, the app asks for a key. The private key stays on the device: in the Android keystore, or in the iOS Keychain.

  1. Tap Create a key, or tap Import a key to use a key that you have. An import takes OpenSSH and PEM keys, with their passphrase.
  2. On the screen Add this key to your machines, tap Copy under Public key.
  3. On each machine, add the public key as a line of ~/.ssh/authorized_keys for your user.
  4. Tap Done.

The screen also shows a command under Or run this on the machine that adds the key for you.

To manage keys later, go to Settings ▸ Keys:

ItemWhat it does
Show public key, Copy public keyShows or copies the public key of this key.
Use for every machineMakes all machines sign in with this key.
Export private keySaves the private key to a file or copies it, encrypted with a passphrase. The device asks for your screen lock (Face ID or the passcode on iOS) first.
Rotate keyMakes a new key. Add its public key on each machine, then tap Use for every machine. Remove the old key from the machines last.
Import a keyAdds a key that you have.

Add a machine #

  1. On the Machines screen, tap Add machine.
  2. Type the Host: a host name or an IP address.
  3. Type the User, the account that you sign in as.
  4. If ssh does not use port 22, change the Port.
  5. Optionally, type a Name for the list.
  6. Tap Save.
FieldWhat it does
NameThe name in the list. Empty: the list shows the host.
Host, Port, UserThe ssh destination. Put the user and the port in their own fields, not in the host.
KeyThe key that signs in, when you have more than one.
Connection timeout3 to 60 seconds. Empty: the app uses the value from Settings ▸ Connections.
Pinned host keyThe host key fingerprint that you trusted. Shows when you edit a machine.

At the first connection, the app shows the host key fingerprint and asks Trust NAME?. To check the fingerprint, run the command that the app shows on the machine. Then tap Trust and connect. If the host key changes later, the app does not connect and tells you. If you know why the key changed, tap Remove pinned key, then trust the new key.

A machine row shows its state: Connected, Connecting, Reconnecting, Unreachable or Not connected. When it is connected, the row shows how many sessions are Working, Waiting, Done or Idle. Use the row menu to Connect, Disconnect, Edit or Remove the machine.

Sessions on a machine #

Open a machine to see its sessions. The list has two groups: Attached (the sessions that the app shows) and On MACHINE (the other sessions).

ActionWhat it does
New sessionCreates a session on the machine and attaches it. To give it a name, use New named session.
AttachShows the session in the app.
DetachRemoves the session from the app. The session continues on the machine.
Duplicate sessionMakes a copy of the session on the machine.
Rename sessionChanges the name of the session.
Chat viewSets the chat view on or off for this session.
End sessionStops the session on the machine, with all its programs. You cannot undo this.

If ngtermctl is not on the machine, the app tells you how to install it. If the machine is a Mac that runs agterm, its rows have the mark agterm. These rows have no chat view. Refer to agterm Macs.

The terminal view #

A session shows its terminal. If the session has a split, both panes show on a wide screen. On a phone, one pane shows at a time: tap a pane number, or swipe to the side. A pinch changes the text size of one pane.

Above the keyboard, the extra keys row gives Esc, Tab, Ctrl, Alt, /, |, ~, Home, End, Page up, Page down and the arrow keys. Tap Ctrl or Alt once for the next key only. Tap it again to lock it. A hardware keyboard hides the row.

The chat view #

A pane that runs Claude Code or Codex can show as a chat. The chat shows the replies of the agent, the tools it runs, its questions and its permission requests. To go between the chat and the terminal, tap Show terminal or Show chat in the session bar.

To send a prompt:

  1. Type the prompt in the box. Type / to see the commands and skills of the agent.
  2. To add a photo, a video or a file, tap Attach a file. A file can be 32 MB or less.
  3. Tap Send.

When the agent asks for a permission, a card shows Allow TOOL? with the buttons of the agent. Answer the card before you send a new prompt. To stop the agent, tap Stop.

The chat view must have the agent status hooks from a current ngterm on the machine. Refer to Agent status. To set the chat view off for all sessions, use Settings ▸ Agents ▸ Agent chat view.

Notifications on the phone #

The app tells you when an agent asks a question, waits for you, or finishes, and when a machine with attached sessions goes offline. It also shows the messages from ngtermctl notify. You can answer a simple question from the notification. The app asks for the notification permission once. The iOS app asks when you attach the first session.

PlatformWhen notifications come
AndroidWhile sessions are attached, Android shows one quiet notification Attached sessions. It keeps the sessions connected in the background. Detach all in that notification detaches all sessions.
iOSWhile the app is open, and for approximately 20 seconds after you leave it. After that, iOS lets the app check the attached sessions at most once in 15 minutes, when iOS decides. These checks show only agents that wait or finish. The app does not use push notifications.

Phone app settings #

Open Settings from the navigation (Android) or from the gear on the Machines screen (iOS).

SectionSettings
TerminalText size (8 to 32, default 13), Font (JetBrains Mono or the monospace font of the device), Colors (Match the theme, Copper, Drafting, Ghostty), Keep the screen on (while a session is open).
AppearanceLight, dark, or the system mode. Android 12 and later also have Wallpaper colors.
Extra keysFit to the width, Always two lines, Hidden.
ConnectionsConnection timeout: 3 to 60 seconds, default 10. The value of a machine wins.
AgentsAgent chat view: on by default.
NotificationsQuestions, Waiting for you, Finished, Agent notifications, Lost machines. Android also has App updates.
ClipboardThe machines that can read your clipboard without a question. Tap Ask again to remove one.
KeysRefer to Set up the ssh key.
DiagnosticsLogs: what the app and its connections did. Copy or share the log when you report a problem. The log does not keep what you type, terminal output, chat messages or keys.
AboutThe app version.

Updates of the phone app #

The Android app looks for a new release on GitHub when it starts, and twice a day. To check now, go to Settings ▸ Updates and tap Check now. The app checks the download against the release signature before Android installs it. To stop the checks, set Check automatically to off.

The iOS app does not look for updates. Download and install a new .ipa from the Releases page.

iPad #

On an iPad, the app shows three columns: machines, sessions and the session. To give a session its own window, select Open in New Window in the session menu. With a hardware keyboard, these keys work:

ActionKeys
Bigger text⌘+
Smaller text⌘-
Default text size⌘0
Next pane, previous pane⌥⌘→, ⌥⌘←
Next session, previous session⌥⌘↓, ⌥⌘↑
Send in the chat⌘↩

Settings #

Settings opens as a panel inside the current window. ngterm saves each change at once, and most changes apply at once.

To open Settings:

To close Settings, push Esc, click the close button, or click outside the panel. Settings has six panes: General, Appearance, Interface, Notifications, Agent Status and Key Mapping.

ngterm keeps the settings in settings.json in the state folder (refer to Files and folders). Some settings also go into the terminal configuration. Refer to Ghostty config and themes.

General #

Mouse

SettingValuesWhat it does
Scroll speed1x to 10x, default 3xSets how many lines one step of the mouse wheel scrolls.
Right-click pastesOn (default) or offOn: a right-click in a terminal pastes. Off: a right-click does nothing.
Open links inBrowser (default), Session overlay, Session overlay at 95%, Session overlay at 75%, Session overlay at 50%Sets where a clicked http or https link opens: in your web browser, or in a web overlay over the session. Refer to Pages and viewers.
Click a workspace row to expand or collapseOn (default) or offOn: a click on a workspace row in the sidebar opens or closes the workspace.

Sessions

SettingValuesWhat it does
New sessions open inHome directory (default), Current session’s directory, Custom directorySets the start folder of a new session. For Custom directory, click Choose… to select the folder.
Name sessions after the terminal titleOff (default) or onOn: a session without a name of its own takes the title that its program sets. Off: it takes the name of its folder.
New sessions are addedAt the end of the workspace (default), After the current sessionSets where a new session goes in the sidebar.
Default shellConfig / system default, then each shell that ngterm findsSets the shell of new sessions. Shows on Windows, and on other systems when you defined shell profiles. To select a shell for one session, use the + menu in the sidebar.
Restore sessionsFresh shells (default), Re-run commands, Live sessionsSets what comes back after you quit and start ngterm again. The change applies after a restart. Refer to Restore and Live sessions.
Confirm before closing a sessionOff (default) or onOn: ngterm asks before it closes a session.
Allow undo after closing sessions and workspacesOn (default) or offOn: you can reopen a closed session or workspace for a short time.
Flagged view layoutFlat list (default), Flat list, names only, Workspace treeSets how the sidebar arranges the flagged sessions.
Use my global Ghostty configOff (default) or onOn: ngterm also loads your own Ghostty config file. Refer to Ghostty config and themes.

If the default shell is no longer installed, the pane tells you to select a different profile. If the selected profile cannot run as a Live session, the pane tells you that the profile opens a fresh shell.

Updates

SettingValuesWhat it does
Automatically download updatesOn (default) or offOn: official releases check for an update at start and every six hours, and download it in the background. Click Install Update in the title bar when a download is ready.

Appearance #

Terminal

SettingValuesWhat it does
Font nameDefault, then each monospaced font on your systemSets the terminal font. Default uses the font from the Ghostty config.
Font size8 to 32, default 13Sets the terminal font size in points.
Cursor shapeDefault, Block, Bar, UnderlineSets the cursor shape. Default uses the shape from the Ghostty config.
Cursor blinkDefault, Blink, SteadySets if the cursor blinks. With Default, a program can start or stop the blink.
Themedefault ghostty, then the bundled themesSets the terminal colors. default ghostty is the built-in Ghostty colors.
Follow system appearanceOff (default) or onOn: ngterm uses one theme in light mode and a second theme in dark mode.
Light theme or Dark themeThe bundled themesShows when Follow system appearance is on. Sets the theme of the other mode.

Window

SettingValuesWhat it does
ToolbarNormal, Compact (default), HiddenSets the title bar: the session name over a second line, one short row, or no row.
Background Opacity0% to 100%, default 100%Makes the window background transparent.
Background Blur0 to 100, default 0Blurs what is behind a transparent window. It works only when the opacity is less than 100%.
Ignore Reduce TransparencyOff (default) or onOn: the window uses the opacity and blur also when the system asks for less transparency.
Sidebar TintLighter 5 to Darker 5, default NoneMakes the sidebar background lighter or darker than the terminal background.
Sidebar font size9 to 20, default 13Sets the text size of the sidebar rows.
Sidebar densityDefault, CompactCompact makes the sidebar rows closer together.
Palette and switcher font size9 to 20, default 13Sets the text size of the palettes and the session switcher.
Inactive pane and backdrop mute0 to 10, default 5Sets how much ngterm dims the split pane that does not have the keyboard, and the area behind a floating panel.

Interface #

Each toggle shows or hides one control. On means that the control shows.

Title Bar

ToggleDefaultControl
Workspace nameOffThe name of the current workspace.
Session nameOnThe name of the current session.
Window nameOnThe name of the window.
Session contextOnThe context text of the session.
Sidebar toggleOnThe button that shows or hides the sidebar.
Remote hostOnThe host of an attached remote session.
Recent sessionsOnThe button that lists the sessions you used most recently.
Scratch terminalOnThe scratch terminal button.
Split viewOnThe split button.
Hide overlaysOffThe button that hides and shows the overlays.
DashboardOnThe dashboard button.
Quick terminalOnThe quick terminal button.
Custom commandsOffThe custom commands button.

Sidebar

Toggle or settingDefaultWhat it does
New workspaceOnShows the new workspace button.
New sessionOnShows the new session button.
Flagged viewOnShows the flagged view button.
Workspace filterOnShows the workspace filter button.
Workspace add-sessionOnShows the add-session button on a workspace row.
Workspace iconsOnShows workspace icons.
Session iconsOnShows session icons.
Workspace chevronsOnShows the chevron that opens and closes a workspace.
Session infoAlwaysSets when a session row shows its info line: Always, Flagged (flagged sessions only) or Off.
Active window onlyOffOn: only the window that has the keyboard shows its sidebar.

Quick Terminal

SettingValuesWhat it does
SizeDefault, or 40% to 90% of the screen in steps of 10%Sets the size of the quick terminal.

Notifications #

SettingValuesWhat it does
Show notification bannersOn (default) or offOn: ngterm shows desktop notifications.
Show notification badgesOn (default) or offOn: a session row shows a badge for its notifications.
Badge resetOn first key (default), On Enter, DisabledSets when a badge goes away: at the first key in the session, at Enter, or never.
Bounce Dock iconNone (default), Once, Until focusedThis version keeps the value, but does not use it.
Notification soundNone, or a sound namePlays a sound with each notification. On macOS, each name is a system sound. On Linux and Windows, each name plays the system alert sound.
Show attention indicatorOff (default) or onOn: the title bar shows an indicator when a session waits for you.

Refer to Notifications.

Agent Status #

SettingValuesWhat it does
Active, Blocked, CompletedA color and a shapeSets the color and the shape of the status glyph in the sidebar. The shapes are Circle, Square, Triangle, Down Triangle, Play, Diamond, Capsule, Seal, Star, Bolt, Bell and Checkmark.
Blocked soundNone, or a sound namePlays a sound when an agent becomes blocked.
Status resetOn first key (default), On Enter, DisabledSets when typing in a session clears its status glyph.
Attention navigation includes active sessionsOff (default) or onOn: the keys that go to the next session that waits for you also stop at active sessions.
Attention navigation crosses windowsOff (default) or onOn: these keys also go to sessions in other windows.
Auto-follow blocked sessionsDisabled (default), 5 sec idle, 10 sec idle, 30 sec idle, 60 sec idle, 5 min idleWhen you do not type for this time, ngterm selects a session that is blocked.
Auto-follow away from a running sessionOn (default) or offOff: auto-follow does not leave a session that is active. Works only when auto-follow is on.

Click Reset to defaults to set the colors, shapes and these settings back to the defaults. Refer to Agent status.

Key Mapping #

ItemWhat it does
Lock in ngtermSelects a keyboard layout while ngterm has the keyboard. When you go to a different app, your previous layout comes back. Off (default) keeps your layout.
Config DirectoryShows the folder of keymap.conf, hooks.conf, ghostty.conf and remotes.conf. Click Choose… to use a different folder, or Use Default to go back to the default. A change reloads the files.
DiagnosticsShows the problems in keymap.conf. Click Reload to read the file again.
HooksShows the problems in hooks.conf. Click Reload to read the file again.

On Linux, Lock in ngterm works on X11, and on Wayland with sway, Hyprland, niri and KDE Plasma. On a different desktop, the picker is off and shows the reason. Refer to Keys and custom commands and Event hooks.

Ghostty config and themes #

ngterm draws its terminals with the engine of Ghostty. It reads Ghostty config files, with the same key = value lines. The full key reference is at https://ghostty.org/docs/config.

The ghostty.conf file #

ghostty.conf is in the config folder, beside keymap.conf. Put your terminal settings for ngterm in this file. The Ghostty app does not read it.

To edit the file:

  1. Select File ▸ Edit ghostty.conf…. The file opens in your editor in an overlay.
  2. Save the file and close the editor.

ngterm reloads the config when the editor closes. If you edit the file in a different way, select File ▸ Reload Config or run ngtermctl config reload.

If the config has problems, ngterm shows a banner. ngtermctl config reload prints the number of problems.

ngterm builds the terminal config from these sources, in this order. A later source wins over an earlier one:

  1. The Ghostty defaults, and the ngterm defaults below.
  2. Your global Ghostty config, only when Settings ▸ General ▸ Use my global Ghostty config is on. On Linux and macOS, this is ~/.config/ghostty/config and ~/.config/ghostty/config.ghostty. On Windows, it is in %LOCALAPPDATA%\ghostty.
  3. ghostty.conf in the ngterm config folder.
  4. The values from Settings.

The global Ghostty config is off by default, so a config for the Ghostty app does not change ngterm.

These Settings write a Ghostty key. The Settings value wins over the same key in ghostty.conf:

SettingGhostty keyWhen Settings writes it
Font namefont-familyWhen it is not Default.
Font sizefont-sizeWhen you set a size.
Theme, Light theme, Dark themethemeWhen it is not default ghostty.
Cursor shapecursor-styleWhen it is not Default.
Cursor blinkcursor-style-blinkWhen it is not Default.
Scroll speedmouse-scroll-multiplierAlways.
Right-click pastesright-click-actionAlways: paste or ignore.

ngterm starts from these defaults, and your config can change each of them:

window-padding-x = 8
window-padding-y = 6
cursor-style = block
shell-integration-features = no-cursor,no-title
cursor-click-to-move = false
keybind = ctrl+shift+key_c=copy_to_clipboard
keybind = ctrl+shift+key_v=paste_from_clipboard
keybind = ctrl+shift+key_a=select_all

The three keybind lines make copy, paste and select all work on each keyboard layout.

Ghostty keys that work #

ngterm accepts each key that Ghostty knows, and checks its value as Ghostty does. These keys change ngterm:

AreaKeys
Colorstheme, background, foreground, palette, background-opacity, split-divider-color
Fontfont-family, font-family-bold, font-family-italic, font-family-bold-italic, font-feature, font-size
Cursorcursor-style, cursor-style-blink, cursor-color, cursor-text, cursor-opacity, cursor-click-to-move, cursor-invert-fg-bg
Selectionselection-foreground, selection-background, selection-clear-on-typing, selection-clear-on-copy, selection-word-chars, selection-invert-fg-bg, copy-on-select
Background imagebackground-image, background-image-opacity, background-image-position, background-image-fit, background-image-repeat
Paddingwindow-padding-x, window-padding-y, window-padding-balance, window-padding-color
Clipboardclipboard-read, clipboard-write, clipboard-write-limit-bytes, clipboard-trim-trailing-spaces, clipboard-paste-protection, clipboard-paste-bracketed-safe, clipboard-codepoint-map
Mousemouse-hide-while-typing, mouse-shift-capture, mouse-reporting, mouse-scroll-multiplier, right-click-action, middle-click-action, click-repeat-interval, focus-follows-mouse
Scrollbackscrollback-limit-bytes, scrollback-limit-lines
Programscommand, env, input, working-directory, shell-integration, shell-integration-features, wait-after-command, abnormal-command-exit-runtime, term
Otherkeybind, config-file, title, link-url, grapheme-width-method, image-storage-limit, macos-option-as-alt (macOS only)

keybind lines apply in the terminal after the ngterm keymap. If a key is bound in keymap.conf, ngterm uses that binding first. Refer to Keys and custom commands.

Ghostty keys that do nothing #

ngterm accepts the other Ghostty keys without an error, but they change nothing. Ghostty default behavior stays, or ngterm uses its own feature. These are the main groups:

For window size, opacity, blur, the quick terminal and notifications, use Settings.

Themes #

ngterm includes the full Ghostty theme catalog. At first, ngterm uses default ghostty, the built-in Ghostty colors.

To select a theme, do one of these steps:

To use one theme in light mode and a different theme in dark mode, set Settings ▸ Appearance ▸ Follow system appearance to on. Then select the second theme in Light theme or Dark theme. From a script, run ngtermctl theme set --dark NAME.

To add a theme of your own, put a Ghostty theme file in ~/.config/ghostty/themes (%LOCALAPPDATA%\ghostty\themes on Windows). Then write its file name as the theme value in ghostty.conf. ngterm looks in this folder before the bundled themes.

Fonts #

Select the font in Settings ▸ Appearance ▸ Font name. The list shows the monospaced fonts on your system. To set different fonts for bold or italic text, or OpenType features, use font-family-bold, font-family-italic, font-family-bold-italic and font-feature in ghostty.conf. To change the size of one pane, use the font size keys. Refer to Keys and custom commands.

Keys and custom commands #

keymap.conf in the config folder sets the keys of ngterm. With it, you can:

Edit the keymap #

  1. Select File ▸ Edit Keymap…. The file opens in your editor in an overlay over the session.
  2. Make your changes, save the file and close the editor.

ngterm reloads the file when the editor closes. If you edit the file in a different way, select File ▸ Reload Keymap or run ngtermctl keymap reload.

When ngterm starts and keymap.conf does not exist, ngterm writes a starter file. All its lines are comments, so it changes nothing. It lists each action with its default key, and each command token.

The editor is the first that ngterm finds:

Settings ▸ Key Mapping ▸ Diagnostics shows the lines that ngterm could not use. ngtermctl keymap list shows each action with its key, each custom command, and the problems.

The keymap.conf format #

Each line starts with a verb. Blank lines and lines that start with # are ignored. A # after a space, outside quotes, also starts a comment to the end of the line.

# give a built-in action a different key
map ctrl+shift+l toggle_split
# two keys for one action
map ctrl+shift+y|ctrl+a>s toggle_scratch
# a custom command on a leader sequence
command "Lazygit" ctrl+a>g ngtermctl session overlay open 'sh -lc lazygit' --target "$AGT_SESSION_ID" --socket "$AGT_SOCKET"
# a custom command in the palette only
command "Deploy" ./deploy.sh
# a system-wide key for the quick terminal
global-hotkey ctrl+opt+space
VerbFormatWhat it does
mapmap CHORD [--repeat] ACTIONGives a built-in action this key. The key replaces the default key of the action.
commandcommand "NAME" [CHORD] [--repeat] [ERROR OPTIONS] SHELL LINEAdds a custom command. Without a chord, the command is in the palette only.
global-hotkeyglobal-hotkey CHORDSets one system-wide key that shows the quick terminal. A second line replaces the first.

A chord is modifiers and one key, joined by +:

PartValues
Modifiersctrl (or control), shift, opt (or option, alt), cmd (or command). On Linux and Windows, cmd is the Super key.
KeysOne character (a, 5, /, `), tab, space, return, delete, left, right, up, down, f1 to f20

Write chords in Latin letters. Use the base key with shift, not the shifted character: shift+/ is ?, shift+= is +. On a keyboard layout that cannot type Latin letters, ngterm matches the physical key position.

More chord rules:

If you already use the default key of a newer action for a different binding, your binding keeps the key. The newer action then has no key.

The global hotkey #

The global-hotkey key works when a different app has the keyboard. It must have a modifier, or be a function key. It cannot be a leader sequence or have alternatives. There is no default.

PlatformHow ngterm registers the key
macOSA system hotkey, by physical key position.
WindowsA system hotkey.
Linux on X11A key grab.
Linux on WaylandThe global shortcuts portal of the desktop (KDE Plasma, GNOME 48 and later, Hyprland). The desktop can ask you to confirm the key.

On a Wayland desktop without that portal, add a shortcut in the desktop settings that runs ngtermctl quick toggle.

Default keys #

This table shows each action that you can bind, with its name for keymap.conf. A dash means that the action has no default key. The menus show the current key of each command.

Actionkeymap.conf nameLinux and WindowsmacOS
New Windownew_windowCtrlShiftN⌥⌘N
Rename Window…rename_window––
Delete Windowdelete_window––
Previous Windowprevious_window––
Next Windownext_window––
New Workspacenew_workspaceCtrlShiftW⇧⌘N
Rename Workspacerename_workspace––
Delete Workspacedelete_workspace––
New Sessionnew_sessionCtrlShiftT⌘N
Open Directory…open_directoryCtrlShiftO⌘O
Rename Sessionrename_session––
Duplicate Sessionduplicate_session––
New Companionnew_companion––
Duplicate as Companionduplicate_companion––
Convert to Companionconvert_companion––
Close Sessionclose_sessionCtrlShiftQ⌘W
Reopen Last Closed Itemreopen_recentCtrlAltShiftT⇧⌘T
Reopen Closed Item (undo a close)undo_closeCtrlShiftZ⌘Z
Clear Statusclear_status––
Increase Font Sizeincrease_font_sizeCtrl=⌘+
Decrease Font Sizedecrease_font_sizeCtrl-⌘-
Actual Sizereset_font_sizeCtrl0⌘0
Toggle Vertical Splittoggle_splitCtrlShiftD⌘D
Toggle Horizontal Splittoggle_horizontal_splitCtrlShiftH⇧⌘D
Show or Hide Scratchtoggle_scratchCtrlShiftJ⌘J
Toggle Terminal Zoomtoggle_terminal_zoomCtrlShiftEnter⇧⌘↩
Show or Hide Overlaystoggle_overlayCtrlAltShiftJ⇧⌘J
Find…toggle_searchCtrlShiftF⌘F
Show or Hide Sidebartoggle_sidebarCtrlShiftS⌃⌘S
Select Theme…select_theme––
Toggle Full Screentoggle_fullscreenF11⌃⌘F
Show Flagged Sessionstoggle_flagged_view––
Flag Sessiontoggle_flagCtrlShiftG⇧⌘F
Focus Workspacefocus_workspace––
Toggle Workspace Filtertoggle_workspace_filter––
Previous Workspaceprevious_workspace––
Next Workspacenext_workspace––
Collapse Workspacetoggle_workspace_collapse––
Focus Left Panefocus_left_paneCtrlShift←⌥⌘←
Focus Right Panefocus_right_paneCtrlShift→⌥⌘→
Previous Sessionprevious_sessionCtrlShift↑⌥⌘↑
Next Sessionnext_sessionCtrlShift↓⌥⌘↓
Previous Attention Sessionprevious_attention_sessionAltShift↑⌃⌥↑
Next Attention Sessionnext_attention_sessionAltShift↓⌃⌥↓
First Sessionfirst_session––
Last Sessionlast_session––
Quick Terminalquick_terminalCtrl`⌃`
Go to Session (session palette)session_paletteCtrlP⌃P
Command Palettecommand_paletteCtrlShiftP⌃⇧P
Custom Commands (palette)custom_command_paletteCtrlAltShiftO⌃⇧O
Show Attentionshow_attentionCtrlShiftI⌃⇧I
DashboarddashboardCtrlShiftM⇧⌘G
Attach Remote…attach_remoteCtrlShiftR⇧⌘R
Open Remote Window…open_remote_window––
Detached Sessions…detached_sessions––
Edit Flagged Sessions…edit_flagged_sessions––
Edit Focused Workspaces…edit_focused_workspaces––
Search Sessions…focus_sidebar_searchCtrlAltShiftF–

When a split is top and bottom, Focus Left Pane and Focus Right Pane become Focus Top Pane and Focus Bottom Pane.

Some keys are not in keymap.conf:

Custom commands #

A custom command runs a shell line. On Linux and macOS the line runs with /bin/sh -c. On Windows it runs with cmd.exe /D /S /C, and you write variables as %AGT_SESSION_ID%.

To start a custom command, do one of these steps:

The command starts without a terminal, and ngterm does not wait for it. Thus a command is good for scripts and GUI apps. To run a full-screen program such as lazygit, open it in an overlay with ngtermctl session overlay open, as the example above shows.

The command finds programs on the PATH of ngterm, plus the folder of ngtermctl. Your shell profile does not run. Thus use full paths, or wrap the line in $SHELL -lc '…'.

If a command fails, ngterm shows a notification. To also show a panel over the session for ten seconds, add error options after the chord:

OptionWhat it does
--error-hudShows a panel with the command name, the exit status and the last error line.
--error-position POSSets where the panel shows: top-left, top-center (or top), top-right, center-left, center (default), center-right, bottom-left, bottom-center (or bottom), bottom-right.
--error-pane left or rightPuts the panel over one pane of a split.
command "Build" ctrl+a>b --error-hud ./build.sh
command "Deploy" --error-position top-right --error-pane left --error-hud ./deploy.sh

--error-position and --error-pane work only together with --error-hud. Without it, ngterm rejects the line. The first word that is not an option starts the shell line. To end the options explicitly, write --.

Command tokens #

ngterm gives each command the context of the pane where you pushed the key. Each value is an environment variable, and also a {TOKEN} that ngterm replaces in the shell line.

VariableValue
AGT_SESSION_IDThe ID of the session.
AGT_SESSION_NAMEThe name of the session.
AGT_SESSION_PWDThe current folder of the pane.
AGT_SESSION_HOSTThe ssh destination of an attached remote session. Empty for a local session.
AGT_WORKSPACE_IDThe ID of the workspace.
AGT_WORKSPACE_NAMEThe name of the workspace.
AGT_WINDOW_IDThe ID of the window.
AGT_WINDOW_NAMEThe name of the window.
AGT_PANEThe pane: left (the main pane), right (the split pane) or scratch.
AGT_PANE_IDThe token of the pane, the same value as NGTERM_PANE_ID in its shell.
AGT_SELECTIONThe selected text.
AGT_SOCKETThe control socket. Give it to ngtermctl as --socket "$AGT_SOCKET".

A command that uses a session, workspace or selection value does nothing when no session is selected.

Event hooks #

An event hook runs a shell line when something happens in ngterm. For example, a hook can play a sound when an agent is blocked, or write a log line when a session closes. The hooks are in hooks.conf, in the config folder beside keymap.conf.

Edit the hooks #

  1. Select File ▸ Edit Hooks…. The file opens in your editor in an overlay.
  2. Add or change the lines, save the file and close the editor.

ngterm reloads the file when the editor closes. If you edit the file in a different way, select File ▸ Reload Hooks or run ngtermctl hooks reload. When ngterm starts and hooks.conf does not exist, ngterm writes a starter file with comments and examples.

Settings ▸ Key Mapping ▸ Hooks shows the lines that ngterm could not use. ngtermctl hooks list shows each hook, its running process, the events that wait for it and its last failure.

The hooks.conf format #

Write one hook on each line: on, the event kind, then the shell line. Blank lines and lines that start with # are ignored.

on status [ "$AGT_EVENT_STATUS" = blocked ] || exit 0; canberra-gtk-play -i dialog-warning
on session.closed echo "$(date +%T) closed $AGT_SESSION_ID" >> ~/ngterm-sessions.log
on app.launched ~/.config/ngterm/hooks/layout.sh

You can write more than one line for one kind. Each line is a different hook. ngterm skips a line that is the same as an earlier line.

The events #

KindWhen it fires
statusThe agent status of a session changes: idle, active, blocked or completed. A change of only the blink, pane, color or shape also fires.
notifyA session posts a notification. It also fires when desktop banners are off.
session.createdA session comes into a window. A companion also gives its parent.
session.closedA session leaves a window.
session.selectedThe selected session of a window changes.
tree.changedNames, order or members change in a window, or an overlay, page or HUD opens or closes. ngterm combines the changes of 100 ms into one event.
pane.splitThe split pane shows or hides.
pane.scratchThe scratch terminal shows or hides.
pane.focusedThe keyboard goes to the other pane of a split.
remote.openedA row of an attached remote session comes into a window.
remote.closedA row of an attached remote session leaves a window.
app.launchedngterm started. It fires once for each start, when the control socket is ready.
messagengterm queued a message for a pane (ngtermctl msg). The event does not contain the message text.

To recreate something at each start of ngterm, use on app.launched.

What a hook receives #

A hook receives the event as one JSON object on standard input, the same as ngtermctl events --json prints. It also receives these environment variables. A variable is empty when the event does not have the value.

VariableValue
AGT_EVENT_KINDThe event kind, for example status.
AGT_EVENT_STATUSThe status of a status event, or shown or hidden for pane.split and pane.scratch.
AGT_EVENT_HOSTThe ssh destination of a remote session.
AGT_SESSION_IDThe session ID.
AGT_WORKSPACE_IDThe workspace ID.
AGT_WINDOW_IDThe window ID.
AGT_SOCKETThe control socket. Give it to ngtermctl as --socket "$AGT_SOCKET".

The JSON object has seq, ts (a Unix time), kind, the window, workspace and session IDs when they apply, and payload. Refer to ngtermctl events in ngtermctl.

How hooks run #

Files and folders #

ngterm keeps your config files in the config folder, and its own data in the state folder.

FolderLinux and macOSWindows
Config folder~/.config/ngterm%APPDATA%\ngterm
State folder~/.local/share/ngterm (or $XDG_DATA_HOME/ngterm)%LOCALAPPDATA%\ngterm

To move the config folder, use Settings ▸ Key Mapping ▸ Config Directory. If you set NGTERM_STATE_DIR, the state folder is that folder. The config folder is then its config subfolder, but only if Config Directory in Settings is empty. A folder in Config Directory always comes first.

Config files #

You can edit these files. When ngterm starts and keymap.conf or hooks.conf does not exist, ngterm writes a starter file.

FileWhat it holds
keymap.confKeys and custom commands. Refer to Keys and custom commands.
hooks.confEvent hooks. Refer to Event hooks.
ghostty.confTerminal settings in the Ghostty format. Refer to Ghostty config and themes.
remotes.confRemote machines and connection timeouts. Refer to Remote machines.
restore-denylist.confPrograms that Re-run commands does not start again. Refer to Restore and Live sessions.

State files #

Do not edit these files while ngterm runs.

File or folderWhat it holds
settings.jsonThe values from Settings.
ngterm.logThe log. At start, when the log is larger than 8 MB, ngterm moves it to ngterm.log.1.
ngterm.sockThe control socket. On Windows, ngterm uses a named pipe and no file is there.
windows.json, windows/Your windows, workspaces and sessions.
recent-closed.jsonThe closed sessions and workspaces that you can reopen.
ghostty-settings.confThe Ghostty keys that Settings writes. ngterm writes it again after each change.
browser/The saved logins and site data of web pages. ngtermctl browser clear removes them.
uploads/The files that you attach in the phone chat view. ngterm removes uploads that are older than one week.
updates/Downloaded updates.

Other files that ngterm reads:

FileLinux and macOSWindows
Global Ghostty config~/.config/ghostty/config, ~/.config/ghostty/config.ghostty%LOCALAPPDATA%\ghostty\config, config.ghostty
Your own themes~/.config/ghostty/themes%LOCALAPPDATA%\ghostty\themes

Environment variables #

ngterm sets these variables in each shell that it starts:

VariableValue
NGTERM_ENABLED1. The shell runs in ngterm.
NGTERM_SESSION_IDThe ID of the session.
NGTERM_WINDOW_IDThe ID of the window.
NGTERM_WORKSPACE_IDThe ID of the workspace where the shell started. It does not change when you move the session.
NGTERM_SOCKETThe control socket of this ngterm. Give it to ngtermctl as --socket "$NGTERM_SOCKET".
NGTERM_PANEThe pane where the shell started: left, right or scratch.
NGTERM_PANE_IDA token for the pane. It stays with the pane when panes swap.
NGTERM_LIVE_SESSION, NGTERM_LIVE_DIRSet in a pane that runs as a Live session.
TERM_PROGRAMngterm.
TERM_PROGRAM_VERSIONThe ngterm version.
TERMxterm-ghostty, unless term in the Ghostty config sets a different value.

The quick terminal receives only NGTERM_ENABLED and NGTERM_SOCKET.

These variables change how ngterm starts:

VariableWhat it does
NGTERM_STATE_DIRUses a different state folder. The config folder becomes its config subfolder.
NGTERM_CONTROL_SOCKETUses a different path for the control socket of the app.
NGTERM_LOGSets the log level, for example debug. The default is info.

Custom commands and event hooks receive the AGT_* variables. Refer to Command tokens and What a hook receives.

ngtermctl reference #

ngtermctl is the command line tool that controls ngterm. A script, a key binding or a coding agent can use it to do almost everything that you do with the mouse. Help ▸ Developer Documentation… opens this section.

ngtermctl works in the terminals of ngterm without more setup. To use it in other terminals, put it on your PATH (see Get started).

This section gives each command group with its subcommands and the main flags. For the full list of flags of a command, run one of these commands:

ngtermctl --help
ngtermctl session --help
ngtermctl session overlay open --help
ngtermctl help session overlay open

Connect to ngterm #

ngtermctl sends one request to the control socket of a running ngterm and prints the reply. It finds the socket in this order:

  1. The path in the --socket flag.
  2. ngterm.sock in the folder that NGTERM_STATE_DIR names.
  3. The default socket: ~/.local/share/ngterm/ngterm.sock on Linux and macOS ($XDG_DATA_HOME/ngterm when XDG_DATA_HOME is set), and %LOCALAPPDATA%\ngterm\ngterm.sock on Windows.

ngtermctl does not read NGTERM_SOCKET. Each shell in ngterm has NGTERM_SOCKET, which names the socket of the app that started the shell. If more than one ngterm runs, give that path explicitly:

ngtermctl tree --socket "$NGTERM_SOCKET"

On Windows, the app serves a named pipe that it makes from the socket path. Give the path in --socket, not a pipe name.

Put the flags after the subcommand: ngtermctl tree --json is correct, ngtermctl --json tree is a usage error.

Some groups run a default subcommand when you do not name one:

CommandRuns
ngtermctl session splitsession split visibility
ngtermctl session hudsession hud open
ngtermctl quickquick visibility
ngtermctl sidebarsidebar visibility
ngtermctl pickpick open
ngtermctl askask open

These commands work on your computer only and do not use the socket: terminfo install, server install, clipboard set and agent upload. They take no --socket and no --json.

In a session of a remote window, ngtermctl on the server talks to ngterm-headless. It refuses the commands that change a desktop window. For more, see Remote machines.

If no ngterm listens on the socket, the error names the path and the cause:

connect(/home/me/.local/share/ngterm/ngterm.sock) failed: No such file or directory — ngterm may be stopped or unable to accept connections

Output #

Without --json, a command prints a short human answer:

With --json, a command prints the raw reply of the app. Use it in scripts to read ids and values:

{"ok": true, "result": {"id": "3F2A9C1E-…"}}
{"ok": false, "error": "no such session: 3f2a"}

ngtermctl events --json prints one event object on each line. pick and ask print one result object.

Exit codes #

CodeMeaning
0The command succeeded.
1The app refused the request, the connection failed, or a result is still pending.
2The user cancelled a picker, or dismissed a page that --block waits for. Also, pick cancel, ask cancel or --timeout stopped a picker or a question. session wait: the session left the tree.
3ask: the user pushed Esc, closed the dialog or selected the --cancel button. server install: the server is installed, but the agent hooks are incomplete.
64Usage error: an unknown flag, a missing argument or a bad value.
124session wait or msg read --wait: the --timeout passed first.
othersession overlay open --block exits with the status of the program. terminfo install exits with the status of ssh.

Addressing #

Most commands act on one session or workspace. Select it with --target:

ValueSelects
active (default)The selected session, or the current workspace, of the window.
a full idThe session or workspace with that UUID. Case is not important.
a unique prefixThe one id that starts with these characters, as in git.

If no id matches, the command fails with no such session: ID (or workspace, window). If more than one id matches, it fails with ambiguous session prefix 'ID' and lists the first 8 characters of each candidate.

The NGTERM_* variables that each shell receives are in Files and folders.

Some commands also take --op-id, --epoch, --expect-panes or --expect-scratch. A remote window uses them when it talks to ngterm-headless. Do not use them by hand: a desktop app refuses an operation id.

tree #

ngtermctl tree [--json] [--window W] prints the workspaces and sessions of a window.

With --json, each session node has its id, name, cwd, status, split, scratch, overlay, hud and surfaces. It also has foreground and splitForeground: the command line of the program that runs in each pane now. The top level has the state of the window, for example sidebarVisible, sidebarMode, quickVisible and app (the version of the app).

ngtermctl tree --json | jq -r '.result.tree.workspaces[].sessions[] | "\(.id[0:8]) \(.name) \(.status // "idle")"'

events #

ngtermctl events [--kind KIND ...] [--run UUID --after SEQ] [--limit N] [--json] prints control events until you stop it. It does not print terminal output. To read the text of a terminal, use session text.

FlagUse
--kind KINDPrint only these kinds. Repeat the flag, or separate the kinds with commas.
--run UUID --after SEQContinue from a cursor. Use the two flags together.
--limit NEvents in each read, from 1 to 1000 (default 100).
--jsonPrint each event as one JSON object on a line.

Without a cursor, the stream starts now and prints only later events. The app keeps the last 4,096 events of its current run, and more than one reader can read them.

KindWhen it occurs
statusThe agent status of a session changes: idle, active, completed or blocked. A change of blink, pane, color or shape counts too.
notifyngterm accepts a notification for a session. It occurs also when desktop banners are off.
session.createdA session comes into a window. A companion also has parent.
session.closedA session goes out of a window.
session.selectedThe selected session of a window changes.
tree.changedA name, an order or a member changes, or an overlay, page or HUD opens or closes. Read tree --json for the new state.
pane.splitA split is shown or hidden.
pane.scratchA scratch terminal is shown or hidden.
pane.focusedThe focused pane of a split session changes.
remote.openedA session that live attach made comes into the tree.
remote.closedThat session goes out of the tree.
app.launchedngterm started, loaded hooks.conf and accepts connections. It occurs once in each run.
messageA pane received a message from msg send. The event does not contain the text.

Each event has seq, ts, kind, the window, workspace and session ids when they apply, and a payload.

ngtermctl events --kind status,notify

To run a command on an event without a script that reads the stream, use Event hooks.

workspace #

SubcommandDoesMain flags
new [NAME]Creates a workspace and prints its id.--collapsed, --tint COLOR, --tint-on icon|name|icon,name
rename NAMERenames a workspace.--target
deleteDeletes a workspace.--target
selectSelects a workspace.--target
goGoes to the next or previous workspace.--to next|prev
moveMoves a workspace among the others.--to up|down|top|bottom, --target
focus [MODE]Marks a workspace in the sidebar focus set: on, off, toggle (default) or add.--target
filter [MODE]Sets the sidebar workspace filter: on, off or toggle (default).
flag [MODE]Flags or unflags all sessions of a workspace: on, off or toggle (default).--target
collapse, expandCollapses or expands a workspace in the sidebar.--target
tint VALUEColors the row of the workspace, or removes the color with clear.--on icon|name|icon,name
detachHides a workspace of a remote window here. Its sessions continue on the server.--target
reattachShows a detached workspace again.--target (necessary)

A color is one of red, orange, yellow, green, blue, purple, gray, teal, pink, brown, indigo, mint, or a #rrggbb value.

session #

The session group has the most commands. The tables below put them in groups.

Create, select and arrange sessions #

SubcommandDoesMain flags
newCreates a session and prints its id.--cwd DIR, --name NAME, --command CMD, --wait, --workspace ID, --workspace-name NAME, --create-workspace, --after ID, --before ID, --no-select, --parent ID, --tint COLOR
duplicateStarts a new shell in the directory of a session, after it.--companion, --no-select
closeCloses one or more sessions.--target (repeat for a batch), --undoable, --terminate
undoBrings back a session that close --undoable closed, while the undo time lasts.--target UNDO-ID (necessary)
selectSelects a session.--target
goGoes to another session.--to next|prev|first|last|next-attention|prev-attention|N
rename NAMERenames a session.--target
revealOpens the working directory of the session in the file manager.--target
move [WORKSPACE]Moves sessions to a workspace, up or down, or next to another session.--to up|down|top|bottom, --after ID, --before ID, --target (repeat)
flag [MODE]Flags a session for the flagged view: on, off, toggle (default), clear or move.--before ID, --after ID
context TEXTSets the text that the title bar shows for the session, or removes it with --clear.--clear
info TEXTSets the info line under the sidebar row, or removes it with --clear.--markdown, --hide-after SECONDS, --clear
tint VALUEColors the sidebar row, or removes the color with clear.--on icon|name|icon,name
seenClears the unseen-notification badge. It does not change the selection.--target
collapse, expandFolds or unfolds the companions of a parent session in the sidebar.--target
convertMakes a session a companion of a new session in its place, and prints the new id.--companion
detachHides sessions of a remote window here. They continue on the server.--target (repeat)
reattachShows a detached session of a remote window again.--target (necessary)

--command runs the program as the process of the session, in place of the login shell. On Linux and macOS, ngterm runs the line with /bin/sh -c, and on Windows with cmd.exe /D /S /C. In Live sessions mode, the live shell of the pane runs the line, with the syntax and the PATH of that shell. The session closes when the program stops, unless you add --wait. To start a program, use --command, not session type:

id=$(ngtermctl session new --name review --cwd ~/project --command claude --no-select)

--undoable gives a single close the same undo time that the close key gives. With --json, the reply has an undoID. Give it to session undo --target to bring the session back, with its programs. After the undo time, use recent open.

--terminate ends a session that you attached from another computer on that computer too. Without it, the close stops only the connection on your computer. On other sessions, --terminate closes as a plain close does.

Panes #

SubcommandDoesMain flags
split [MODE]Shows or hides the split: on, off or toggle (default). A hidden pane continues to run.--axis vertical|horizontal
split closeCloses the split pane and stops its program.--target
swapExchanges the two panes of a split session.--target
focus [PANE]Focuses primary, split, or the other pane (default).--target
resizeMoves the divider of a split.--split-ratio 0..1, --grow-left F, --grow-right F, --grow-primary F, --grow-split F, --grow-top F, --grow-bottom F
scratch [MODE]Shows or hides the scratch terminal: on, off or toggle (default).--command CMD, --follow
leadMakes this computer the leader of a pane of an attached session, so the program uses its window size.--pane
restartReplaces the shell of a Live pane with a new shell. The new shell runs a command, or the same program again.--command CMD, --pane, --pane-id
restore COMMANDSets the command that a pane runs at the next start of ngterm, in Re-run commands mode.--none, --clear, --pane, --pane-id

session restore keeps the command until you clear it. Do not put secrets in it: ngterm saves it in the state file of the window.

Text in and out #

SubcommandDoesMain flags
type TEXTTypes text into a pane. A newline in the text pushes Enter.--stdin, --pane, --pane-id, --select
pastePastes the system clipboard into a pane.--pane
copyPrints the selected text. It does not change the clipboard.--target
select-allSelects all the text of the terminal.--target
textPrints the text of a terminal.--all (with the scrollback), --lines N, --pane, --pane-id
search [NEEDLE]Opens the search bar, sets the search text, or goes to the next or previous match.--next, --prev, --close

Agent status #

SubcommandDoesMain flags
status STATESets the status glyph: idle, active, completed or blocked.--blink, --auto-reset, --if-idle, --sound NAME, --color #rrggbb, --shape SHAPE, --pane, --pane-id
waitWaits until the status of a session is one of the given values, and prints it.--until STATE (repeat), --timeout SECONDS

A shape is one of circle, square, triangle, triangle-down, play, diamond, capsule, seal, star, bolt, bell or checkmark. The agent status hooks set the status for you (see Agent status).

ngtermctl session wait --target "$id" --until completed --until blocked --timeout 600

Background #

SubcommandDoesMain flags
background image PATHShows a PNG or JPEG image behind the terminal.--opacity 0..1, --fit contain|cover|stretch|none, --position, --repeat, --pane
background text TEXTShows text as a watermark behind the terminal.--color, --opacity, --fit, --position, --pane
background color #rrggbbSets a solid background color.--pane
background clearRemoves the background.--pane

Without --pane, the background is the default of the session. With --pane, it applies to that pane only.

Overlays #

An overlay shows a program or a page above a session. For the pages that an overlay can show, see Pages and viewers.

SubcommandDoesMain flags
overlay open [COMMAND]Runs a program in an overlay, or shows a page.--html FILE, --url URL, --image FILE, --markdown FILE, --text FILE, --block, --wait, --follow, --size-percent N, --width, --height, --pane, --page, --companion
overlay closeCloses the overlay.--pane
overlay hide, show, toggleHides the overlays, or shows them again. A hidden overlay continues to run.--pane
overlay resizeChanges the size of an open overlay.--size-percent N, --width, --height, --full
overlay resultPrints the exit status of the program, or the outcome of a page.--pane, --page ID
overlay submitAnswers a page with a value and closes it.--value TEXT
overlay copyPrints the text that is selected in the overlay.--pane
overlay textPrints the text of the overlay terminal.--all, --lines N, --pane
overlay reloadLoads the HTML page again.--current
overlay navigate STEPGoes back or forward, opens the page in the browser, or shows its file in the file manager (finder).--pane
overlay follow MODEFollows the end of a log page, or stops: on, off or toggle.--pane
overlay search TEXTSearches a text or log page.--next, --prev, --close
overlay changesGoes to the next or previous change of a diff page.--next, --prev
overlay wrap MODEWraps the long lines of a text page: on, off or toggle.--pane

More flags of overlay open:

FlagUse
--line NWith --text, open at line N and mark it.
--tail NWith --text, show only the last N lines.
--follow-fileWith --text, follow the end of the file as it grows.
--navigationWith --html or --url, add the back, forward, reload and browser buttons.
--jsWith --html or --url, let the page run its own JavaScript.
--chromelessWith --html, or --url on localhost, 127.0.0.1 or ::1, show the page without the title strip of ngterm.
--persistentWith --url, keep cookies and site data, so that a login stays after a restart.
--browseWith --url, let the page go to other sites.
--cwd DIRWith --html, let the page read files in this directory.
--background-color #rrggbbSet a background color for the overlay.

--block waits until the program stops and exits with its status. With --html, --block waits until the page submits a value or closes, and prints the outcome:

ngtermctl session overlay open --target "$NGTERM_SESSION_ID" --block htop
ngtermctl session overlay open --target "$NGTERM_SESSION_ID" --html ./choose.html --block

overlay run-job, overlay page-serve and overlay page-attach are for ngterm on another computer. Do not run them by hand.

HUD #

A HUD is a small message panel above a session. The session keeps the focus, and you can continue to type.

SubcommandDoesMain flags
hud open MESSAGEShows a message panel.--file FILE, --markdown, --detail TEXT, --spinner, --spinner-style, --position, --size-percent, --sticky, --no-frame, --background-color, --text-color, --font-size, --hide-after SECONDS, --pane, --pane-id
hud update MESSAGEReplaces the text of the panel. Options that you omit go back to their defaults.the flags of open, except --font-size and --background-color
hud closeRemoves the panel.--target

A position is one of top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right, top or bottom. A spinner style is one of bar, braille, circle, blocks, dot or none.

ngtermctl session hud open --target "$NGTERM_SESSION_ID" "Running the tests" --spinner --position top-right
ngtermctl session hud close --target "$NGTERM_SESSION_ID"

surface #

SubcommandDoesMain flags
zoom [MODE]Zooms a terminal surface to fill the window: show, hide or toggle (default).--target SURFACE|quick|active
cursorPrints the cursor column of a surface, from zero.--target, --pane-id

dashboard #

ngtermctl dashboard [IDS...] opens a grid that shows running sessions. You can look at them, but not type into them.

FlagUse
IDSUp to 9 panes. Add :left or :right to an id to show only that pane of a split session.
--mruFill the grid with the sessions that you used most recently.
--font-size NSet the font size of the cells in points.
--auto-sizeMake the cells smaller when the grid has more cells.
--closeClose the open dashboard.
ngtermctl dashboard 3f2a 9c1e:left 77b0

window #

SubcommandDoesMain flags
new [NAME]Creates and opens a window, and prints its id.--minimized
listLists the windows with their id, name and state.
select [ID]Brings a window to the front, or opens a closed window.
goGoes to the next or previous open window.--to next|prev
close [ID]Closes a window. ngterm keeps its sessions for a later open.
rename ID NAMERenames a window.
delete [ID]Deletes a window. One window always stays.
resize [ID]Sets the size of a window in points.--width, --height
move [ID]Moves a window.--x, --y, --display N
zoom [ID]Maximizes a window, or puts it back to its size.
fullscreen [ID]Toggles full screen.
minimize [ID] [MODE]Minimizes or restores a window: on, off or toggle (default).
remote open HOSTOpens a window that shows the sessions of ngterm-headless on HOST.
remote dismiss [ID]Removes the marks of actions whose result the remote window could not learn.

On Wayland, the compositor puts each window where it decides, so window move cannot place a window.

quick #

SubcommandDoesMain flags
visibility [MODE] (default)Shows or hides the quick terminal: show, hide or toggle (default).
type TEXTTypes text into the quick terminal.--stdin
textPrints the text of the quick terminal.--all, --lines N

sidebar #

SubcommandDoes
visibility [MODE] (default)Shows or hides the sidebar: show, hide or toggle (default).
mode [MODE]Sets the view: tree, flagged or toggle (default).
flagged-layout [LAYOUT]Sets the layout of the flagged view: flat, plain, tree or toggle (default).
density [DENSITY]Sets the row density: default, compact or toggle (default).
expandExpands all workspaces.
collapseCollapses all workspaces except the active workspace.
width POINTSSets the width of the sidebar.

notify #

ngtermctl notify BODY [--title TITLE] [--target ID] posts a desktop notification for a session. The default title is the session name. For the settings that control notifications, see Notifications.

ngtermctl notify --target "$NGTERM_SESSION_ID" --title "Build" "The build is done"

msg #

Panes can send text messages to each other. Each pane has a mailbox. If the agent status hooks are installed, Claude Code and Codex receive the messages of their pane automatically.

SubcommandDoesMain flags
send TEXTSends a message and prints its id.--to SESSION:PANE (repeat), --all, --workspace W, --stdin, --as
readPrints the oldest messages in the mailbox of this pane.--ack, --wait, --timeout SECONDS, --as
ack IDS...Removes messages from the mailbox.--as

PANE is a pane id, or left, right or scratch. --as SESSION:PANE-ID acts as another pane. The default is $NGTERM_SESSION_ID:$NGTERM_PANE_ID.

The mailbox of a pane is on the computer that runs the pane. A local pane cannot send a message to a session that you attached from another computer: msg send refuses it, and the output shows remote session. With --json, the rejection has the reason unknown pane and the detail remote session. In a session of a remote window, msg uses the mailboxes on the server.

ngtermctl msg send "The API is ready" --to "$other:right"
ngtermctl msg read --ack --wait --timeout 300

font #

SubcommandDoesMain flags
incMakes the font larger.--target, --pane
decMakes the font smaller.--target, --pane
resetSets the font back to its default size.--target, --pane

keymap #

SubcommandDoesMain flags
reloadReads keymap.conf again and prints the number of problems in it.
listPrints each action with its keys, the custom commands, and the problems in keymap.conf.
run NAMERuns a custom command, as the command palette does.--target

For the format of keymap.conf, see Keys and custom commands.

hooks #

SubcommandDoes
reloadReads hooks.conf again and prints the number of problems in it.
listPrints each hook with its running process, its queue and its last failure.

For the format of hooks.conf, see Event hooks.

browser #

SubcommandDoes
clearRemoves all cookies and site data that --persistent pages keep. It does not sign you out on the server.
links [MODE]Sets where a web link that you click in a terminal opens: browser, overlay, overlay95, overlay75 or overlay50. Without MODE, it prints the current mode.

browser clear refuses to work while a --persistent page is open.

config #

ngtermctl config reload reads ghostty.conf again and prints the number of problems. For the file, see Ghostty config and themes.

theme #

SubcommandDoesMain flags
set [NAME]Sets and saves the terminal theme. Without a name, it sets the default theme of Ghostty.--light NAME, --dark NAME|none
listLists the bundled themes and marks the current theme.

With a --dark theme, the terminal follows the light or dark appearance of the system.

ngtermctl theme set --light "Catppuccin Latte" --dark "Catppuccin Mocha"

pick #

ngtermctl pick reads items from standard input and shows a fuzzy picker. It prints the result as JSON.

SubcommandDoesMain flags
open (default)Shows the picker and waits for the answer.--prompt TEXT, --query TEXT, --select ID, --allow-custom, --session ID, --timeout SECONDS, --follow, --no-block, --window
result IDPrints the current result of a picker.
cancel IDCancels a picker.

Give one item on each line, or a JSON array of objects with id, label and an optional subtitle. A picker accepts up to 1,000 items. The result is picked, custom or cancelled:

printf 'staging\nproduction\n' | ngtermctl pick --prompt "Deploy to"
# {"result":"picked","id":"staging","label":"staging","index":0}

ask #

ngtermctl ask shows a question dialog and waits for the answer. It prints the answer as JSON.

SubcommandDoesMain flags
open TITLE (default)Shows the dialog.--message TEXT, --button ID=LABEL (up to 6), --default ID, --cancel ID, --destructive ID, --hotkey ID=LETTER, --style terminal|gui, --input line|multiline, --choice ID=LABEL (up to 50), --multiple, --other PLACEHOLDER, --target, --pane, --timeout SECONDS, --no-block
result IDPrints the current result of a dialog.
cancel IDCancels a dialog.

--input adds a text field, and --choice adds a list of items. Without --button, these two forms have the buttons OK and Cancel.

ngtermctl ask "Deploy to staging?" --button yes=Deploy --button no=Cancel --cancel no
ngtermctl ask "Commit message" --input multiline --placeholder "Describe the change"

restore #

These commands control what happens to your sessions when ngterm starts again. For the restore modes, see Restore and Live sessions.

SubcommandDoes
mode [MODE]Prints the restore mode, or sets it for the next start: none (fresh shells), rerun or live.
captureSaves the running command of each pane now, so that a crash does not lose it. Only in rerun mode.
clearClears the saved commands of all sessions, so that the next start opens plain shells.

recent #

SubcommandDoes
listLists the sessions and workspaces that you closed recently, newest first. The list keeps 20 items.
open [ID]Opens a closed session or workspace again. Without an id, it opens the newest item.
clearEmpties the list.

All windows on your computer share one list. With --window naming a remote window, these commands use the list on its server. recent open --window also selects the window where the item opens.

live #

These commands examine and manage the processes that keep Live sessions running.

SubcommandDoesMain flags
listLists each live-session process and the pane that owns it.
screen NAMEPrints the screen of a live-session process, also for a closed window.--all, --lines N
pruneStops the live-session processes that no pane owns and no terminal shows.
killStops the live-session process of one pane and the program in it.--target (necessary), --pane (necessary), --force (necessary)
resetDoes the same as Reset Live Sessions…: ngterm quits, opens again and starts the affected sessions again.--force (necessary)
tree [HOST]Lists the sessions that you can attach, here or on HOST over ssh.
attach HOST SESSIONAttaches a session of another computer as a session here.--companions, --no-select

In live list, claimed means that a pane owns the process. A closed window has claimed rows with zero clients, which is normal. orphan means that no pane owns the process. live prune stops only those.

live tree uses ssh in batch mode, so key-based ssh must work for the host. agterm:HOST asks only agterm on that Mac, and ngterm:HOST only ngterm. For more, see Remote machines.

ngtermctl live tree buildbox
ngtermctl live attach buildbox 3F2A9C1E --companions

live present is for ngterm on another computer. Do not run it by hand.

catalog #

catalog subscribe and catalog op are for remote windows and ngterm-headless. A remote window runs them over ssh. Do not run them by hand.

terminfo #

ngtermctl terminfo install DESTINATION [-p PORT] [-i FILE] [-J HOST] [-F FILE] installs the xterm-ghostty terminfo entry in ~/.terminfo on a remote host over ssh.

Shells in ngterm have TERM=xterm-ghostty. A host without this entry makes less, vim and other full-screen programs show a warning. Run the command one time for each host and account. The host must have tic, which comes with ncurses.

ngtermctl terminfo install me@buildbox

server #

ngtermctl server install DESTINATION [-p PORT] [-i FILE] [-J HOST] [-F FILE] [--from FILE] installs or updates ngterm-headless on a Linux host over ssh. It installs the release that has the same version as your ngtermctl. For the full procedure, see Remote machines.

ngtermctl server install me@buildbox

clipboard #

ngtermctl clipboard set [TEXT] copies text to the clipboard of each terminal that shows this pane. Without TEXT, it reads standard input. The pane must be a main or split pane that started in Live sessions mode.

For a session that you attached from another computer, the text goes to the clipboard of the computer that shows the session.

git rev-parse HEAD | ngtermctl clipboard set

agent #

The agent status hooks and the phone apps use these commands. You do not usually run them by hand.

SubcommandDoes
hook AGENT EVENTSends the data of an agent hook to the agent record of the pane.
answeredTells ngterm that a permission prompt got an answer in its dialog.
interruptedTells ngterm that the chat view stopped a running turn.
chatPrints the conversation of the agent in a pane as NDJSON chat events, and follows it.
commandsPrints the slash commands and skills of the agent in a pane as JSON.
mail AGENTGives the messages in the mailbox of the pane to its agent.
rerun AGENT HOOKRuns a hook as the pane that has the conversation.
uploadSaves a file from standard input for an agent to read, and prints its path.

version #

ngtermctl version prints the version of the app that serves the socket. It also prints the path of the ngtermctl that ran. If the installed app is different from the app that runs, it adds an installed: line. In that case, restart ngterm to use the new version.

ngtermctl version --socket "$NGTERM_SOCKET"

The agent skill #

The agent skill teaches a coding agent how to control ngterm with ngtermctl. With the skill, you can ask your agent in plain words, and the agent finds the correct commands.

The skill is a folder named ngterm. It contains these files:

FileContents
SKILL.mdThe model of ngterm, addressing, the NGTERM_* variables and a summary of all commands.
reference.mdEach ngtermctl command with all flags, the JSON replies and the error messages.
examples.mdExamples for frequent tasks.
cookbook.mdHow to find, read and install recipes from the cookbooks.
troubleshooting.mdHow to find the cause of a problem, and how to write a bug report.
scripts/A helper that shows an image in an overlay, for shells and for PowerShell.

The skill tells the agent to act on its own session ($NGTERM_SESSION_ID). Thus the agent does not change the session that you look at.

Install the skill #

At the first start, ngterm offers to install the agent skill and the agent status hooks. To install the skill later:

  1. Select Help ▸ Install Agent Skill….
  2. Read the report. It lists each agent that received the skill.
  3. If the report says that ngterm made a skills folder for the first time, restart the agent sessions that run.

The installer copies the skill into the skills folder of each agent that it finds:

AgentFolder
Claude Code~/.claude/skills/ngterm
Codex$CODEX_HOME/skills/ngterm (default ~/.codex/skills/ngterm)
Oh My Pi~/.omp/agent/skills/ngterm

If ngterm finds none of these agents, it installs the skill for Claude Code. On Windows, ~ is your user folder.

The installer replaces only a skill that ngterm installed. If you wrote your own skill named ngterm, the installer does not change it and tells you so.

The skill uses ngtermctl. In the terminals of ngterm, ngtermctl works without more setup. For other terminals, select Help ▸ Install Command Line Tool….

The installer copies the skill one time. To update the copy after you update ngterm, select Help ▸ Install Agent Skill… again.

ngtermctl server install and ngterm-headless install the skill on a server for you (see Remote machines).

What you can ask #

When the agent runs in an ngterm session, you can ask in your own words. Some examples:

AreaRequest
Layout“Split this session and run the tests in the other pane.”
Layout“Open a companion session under this one for the dev server.”
Layout“Make a workspace for the API and move these three sessions into it.”
Pages“Make an HTML page that explains this design and show it.”
Pages“Show this Markdown file rendered.” “Open the log at line 120.”
Pages“Show the running dev server in an overlay and keep me logged in.”
Questions“Ask me which branch to deploy.” “Let me pick the files from a list.”
Status“Show a message over the session while you work.”
Status“Notify me when the worker session is done.”
Agents“Start three workers in new sessions and wait until they finish.”
Agents“Send a message to the agent in the right pane.”
Remote“Attach the sessions of buildbox.” “Install ngterm-headless on buildbox.”
Setup“Bind Ctrl+Alt+R to a command that runs the tests.” “Set the dark theme.”
Help“Why does my keymap editor not open?” “Write a bug report for this problem.”

When the agent writes a bug report, it shows you the draft first. It removes private data, and it posts only when you tell it to.

The cookbook #

The cookbook is a set of recipes: workflows that use ngtermctl, with their scripts and setup. Each recipe is a folder with a README, which tells what the recipe does, what it must have, and how to set it up.

ngterm’s cookbook is at https://github.com/nickalie/ngterm/tree/main/cookbook. For example, go-to-navigator binds a key to a searchable tree of all workspaces, sessions and panes.

ngterm also accepts the control commands of agterm. Thus most recipes in agterm’s cookbook (https://github.com/umputun/agterm/tree/master/cookbook) work in ngterm after the names change: agtermctl becomes ngtermctl, and AGTERM_* variables become NGTERM_*.

To use a recipe through the agent:

  1. Ask the agent: “What recipes are there?”
  2. Ask the agent to install the recipe that you select.
  3. Read what the agent shows: what the recipe does, what it must have, and the lines that it adds.
  4. Tell the agent to continue.
  5. If the recipe adds a key, run ngtermctl keymap reload.

The agent reads the recipe from the repository each time. It adds lines to your files and does not replace them. If a key is already in use, the agent asks you.

To add a recipe of your own, read https://github.com/nickalie/ngterm/blob/main/cookbook/CONTRIBUTING.md and send a pull request.

Accessibility #

ngterm gives information to assistive technology on each platform. It uses AT-SPI on Linux, UI Automation on Windows and the macOS accessibility interface.

Screen readers and dictation #

The buttons, menus, dialogs, palettes and sidebar rows have names and roles for screen readers. The toggle buttons also tell if they are on or off. The agent status glyph of a session row gives the name of the status, for example blocked, and a description.

The terminal shows to assistive technology as an editable text area with the name “Terminal”. Dictation tools look for such a field, and they can type into the terminal. ngterm does not give the text of the terminal to a screen reader. To read the text of a terminal from a script, use ngtermctl session text.

The terminal accepts text from input methods. The input method shows its composition at the cursor, and its candidate window opens next to the cursor. On Windows, on-screen keyboards can type into the terminal.

Keyboard #

You can use ngterm without a mouse:

Text size #

SettingWhat it changes
Settings ▸ Appearance ▸ Font sizeThe default font size of the terminals.
View ▸ Increase Font Size, Decrease Font SizeThe font size of the focused pane.
Settings ▸ Appearance ▸ Sidebar font sizeThe text of the sidebar, from 9 to 20 points.
Settings ▸ Appearance ▸ Sidebar densityThe space between the sidebar rows: Default or Compact.
Settings ▸ Appearance ▸ Palette and switcher font sizeThe text of the palettes and the session switcher, from 9 to 20 points.

Motion and transparency #

Some status glyphs and dashboard cells blink when a session asks for your attention. When your system stops animations, they do not blink. The status stays visible. ngterm reads this system setting:

PlatformSetting
LinuxThe animations setting of your desktop, through the settings portal (enable-animations).
WindowsShow animations in Windows.
macOSReduce motion.

When your system reduces transparency, ngterm shows the window opaque and without blur. On Windows, this is the Transparency effects setting. On macOS, this is Reduce transparency. Linux has no such system setting. To keep the transparency of ngterm, set Settings ▸ Appearance ▸ Ignore Reduce Transparency to on.

Color and contrast #

Each agent status has a color and a shape. Thus you can see a status without its color. To change them, open Settings ▸ Agent Status ▸ Colors and Shapes. The shapes include a circle, a square, a triangle, a diamond, a star and a check mark.

To make the terminal text easier to read, select a theme with more contrast in View ▸ Select Theme…. To make the unfocused pane as clear as the focused pane, set Settings ▸ Appearance ▸ Inactive pane and backdrop mute to 0.

Troubleshooting #

This section gives the problems that users frequently have, with the cause and the fix. If your problem is not here, read the log and report the problem.

Read the log #

ngterm writes its log to ngterm.log in its state folder:

PlatformLog file
Linux and macOS~/.local/share/ngterm/ngterm.log
Windows%LOCALAPPDATA%\ngterm\ngterm.log

When the log is larger than 8 MB at the start, ngterm moves it to ngterm.log.1. To write more detail, start ngterm with NGTERM_LOG=debug.

The configuration files report their problems through these commands:

ngtermctl keymap reload   # number of problems in keymap.conf
ngtermctl keymap list     # each problem with its line
ngtermctl hooks reload    # number of problems in hooks.conf
ngtermctl config reload   # number of problems in the Ghostty config

A command prints ok when the file is correct. Otherwise, it prints the number of problems, for example 2 diagnostic(s).

ngtermctl: command not found #

Cause: ngtermctl is not on the PATH of this terminal. The terminals of ngterm always have it. Linux packages and the Windows installer put it on the PATH. The macOS app and a portable copy do not.

Fix: Select Help ▸ Install Command Line Tool…. Then open a new terminal.

ngtermctl cannot connect #

Cause: ngterm does not run, or ngtermctl uses a different socket. ngtermctl does not read NGTERM_SOCKET.

Fix:

  1. Make sure that ngterm runs.
  2. In a session of ngterm, add --socket "$NGTERM_SOCKET" to the command.
  3. Run ngtermctl version --socket "$NGTERM_SOCKET" to see which app answers.

Selected text is not on the clipboard #

Cause: When you select text, ngterm does not copy it to the system clipboard. A middle-click pastes the selection.

Fix: Push CtrlShiftC on Linux and Windows, or ⌘C on macOS. To copy each selection to the clipboard automatically, add this line to ghostty.conf:

copy-on-select = both

HTML pages do not open on Ubuntu #

Cause: Ubuntu 23.10 and later refuse the web sandbox of ngterm until its AppArmor profile is installed. ngterm then refuses each HTML page, and the error names the fix.

Fix: The .deb package installs the profile. For an AppImage or a tarball, do the steps in https://github.com/nickalie/ngterm/blob/main/docs/development.md#webkit-sandbox-on-ubuntu-apparmor. If you move the binary, install the profile again for the new path.

The keymap editor closes immediately #

Cause: Edit Keymap… runs $VISUAL, else $EDITOR, else vi, in an overlay. A graphical editor such as code, subl or zed returns immediately, so the overlay closes. An editor variable that your shell does not export is not used.

Fix: Export the editor with its wait flag in your shell configuration, then start a new session:

export EDITOR='code --wait'

In fish, use set -gx EDITOR 'code --wait'. On Windows, set EDITOR in your user environment variables. Without VISUAL and EDITOR, Windows opens Notepad.

A key or a custom command does nothing #

Cause: One of these:

Fix:

  1. Run ngtermctl keymap list. Read the problems and the key of each action.
  2. Correct keymap.conf.
  3. In the command, use absolute paths, or run it through your login shell, for example $SHELL -lc '…'.
  4. Run ngtermctl keymap reload.

If the command fails, ngterm shows a failure banner. The banner tells you that the key worked.

A program in an overlay closes immediately #

Cause: The program stopped. Exit status 127 means that the shell did not find the program. Overlays and session scratch --command use the PATH of ngterm, not the PATH of your login shell. Outside Live sessions mode, session new --command uses the PATH of ngterm too.

Fix:

  1. Run ngtermctl session overlay result --json and read exitCode.
  2. If the code is 127, give the absolute path of the program, or run it through a login shell:
ngtermctl session new --command "$SHELL -lc 'htop'"

Another exit code means that the program ran and stopped. To keep the last output on the screen, add --wait.

A Live session comes back as a fresh shell #

Cause: One of these:

Fix:

  1. Set Restore sessions to Live sessions, then restart ngterm.
  2. Run ngtermctl live list to see each live-session process and its pane.
  3. Run ngtermctl tree --json and read backedByLive for each pane.

A Live session does not have a fix from an update #

Cause: A Live session keeps the session host that it started with, also after you update ngterm. ngtermctl live list marks such a session outdated.

Fix: Select Reset Live Sessions… in the main menu (the menu bar on macOS), or run ngtermctl live reset --force. ngterm quits, opens again and starts the affected sessions again.

A Ghostty setting has no effect #

Cause: One of these:

Fix:

  1. Put the setting in the ghostty.conf of ngterm (see Ghostty config and themes).
  2. Run ngtermctl config reload, and read the number of problems.
  3. If the key applies only to new sessions, open a new session.

Remote programs say the terminal is not fully functional #

Cause: The remote host does not have the xterm-ghostty terminfo entry.

Fix: Install the entry one time for each host and account:

ngtermctl terminfo install me@buildbox

A notification does not show #

Cause: One of these:

Fix:

  1. Set Show notification banners to on.
  2. Let ngterm show notifications in the notification settings of your operating system.
  3. Run ngtermctl tree --json. If unseen increases for the session, ngterm received the notification.

The agent status does not change #

Cause: The agent status hooks are not installed, or the agent started before the installation.

Fix:

  1. Select Help ▸ Install Agent Status Hooks….
  2. Open a new session, so that the shell loads the new configuration.
  3. Restart the agent. In Pi, you can also run /reload. Restart OpenCode and Oh My Pi.
  4. If you moved the app, install the hooks again.

For each agent, see Agent status.

The status changes on the wrong session #

Cause: The agent process has the NGTERM_SESSION_ID of a different session. A long-running server that started in a session of ngterm, for example tmux, gives its variables to all its panes.

Fix:

  1. To check an agent process, run ps eww PID | tr ' ' '\n' | grep NGTERM_SESSION_ID.
  2. To clear the variables in a running tmux server, run this command, then start the panes again:
for v in NGTERM_ENABLED NGTERM_PANE NGTERM_PANE_ID NGTERM_SESSION_ID NGTERM_SOCKET NGTERM_WINDOW_ID NGTERM_WORKSPACE_ID; do tmux set-environment -g -r "$v"; done
  1. Start tmux and session managers outside ngterm, or remove the NGTERM_* variables with env -u when you start them.

Codex can share one background server between its sessions, with the same result. The shell integration of ngterm starts codex with --no-daemon to prevent this. A codex that starts in a different way, for example with session new --command codex, still uses the shared server. To keep the shared server, set NGTERM_CODEX_KEEP_DAEMON to a value that is not empty.

Claude Code background sessions have no status #

Cause: claude --bg does not give the NGTERM_* variables of the pane to the background session. Its status hooks then do not know the session.

Fix: Give the variables through --settings. Start the background session from the pane that must show the status:

cbg() {
  claude --bg --settings "$(jq -cn \
    --arg s "$NGTERM_SESSION_ID" --arg k "$NGTERM_SOCKET" \
    --arg p "$NGTERM_PANE" --arg i "$NGTERM_PANE_ID" \
    '{env:{NGTERM_SESSION_ID:$s,NGTERM_SOCKET:$k,NGTERM_PANE:$p,NGTERM_PANE_ID:$i}}')" "$@"
}
cbg "your prompt"

Cause: Claude Code shows clickable links only in terminals from its own list, and ngterm is not in that list. ngterm can show the links.

Fix: Start Claude Code with FORCE_HYPERLINK=1 claude. To set the variable for all new shells, add this line to ghostty.conf, run ngtermctl config reload, and open a new session:

env = FORCE_HYPERLINK=1

Cause: A program that reads the mouse, for example tmux with mouse on or vim with mouse=a, takes the clicks. ngterm then does not underline or open links in that program.

Fix: Hold Shift too: CtrlShift and click on Linux and Windows, or ⌘⇧ and click on macOS. To make Shift always win, add mouse-shift-capture = never to ghostty.conf.

Each session restores to the directory where it started #

Cause: ngterm learns the current directory from the shell integration of Ghostty. A shell configuration that replaces the shell with exec, for example a wrapper such as Amazon Q CLI or Kiro CLI, removes the integration.

Fix: Load the integration again in .zshrc, after the line that replaces the shell:

[[ -n "$GHOSTTY_RESOURCES_DIR" ]] && builtin source "$GHOSTTY_RESOURCES_DIR/shell-integration/zsh/ghostty-integration"

bash and fish have their own files in the same folder. In tmux, also add this line to ~/.tmux.conf, then restart the tmux server:

set -as terminal-features ',xterm-ghostty:osc7'

To test the fix, run cd to a different directory. Then run ngtermctl tree --json and read the cwd of the session.

A Claude Code prompt does not respond after you go to another app #

Cause: This is a bug in Claude Code, not in ngterm. When Claude Code shows a question or a permission prompt, it can ignore the keyboard after the window loses the focus and receives it again.

Fix: Answer the prompt before you go to another app. If the prompt does not respond, push Esc and let Claude Code ask again.

A program cannot get a macOS permission #

Cause: macOS asks for some permissions in the name of ngterm. Examples are the camera, the microphone, automation, and the folders Downloads, Desktop and Documents. If you dismiss the request, macOS does not ask again.

Fix: Open System Settings ▸ Privacy & Security. Find the service, and set ngterm to on. For the protected folders, use Files & Folders, or give ngterm Full Disk Access.

Report a problem #

  1. Find the version: run ngtermctl version, or select Help ▸ About Ngterm.
  2. Copy the related part of ngterm.log. Remove tokens, passwords, host names and user names.
  3. Open an issue at https://github.com/nickalie/ngterm/issues/new. Give the steps, what you expected, what occurred, the version and your operating system.

For a question or an idea, open a discussion at https://github.com/nickalie/ngterm/discussions. If the agent skill is installed, you can ask your agent to write the report. It shows you the draft before it posts.

Build from source and contribute #

ngterm is written in Rust. Its terminal engine is libghostty-vt, which Zig builds from the source of Ghostty. The repository pins the Rust and Zig versions. On Linux, the build also uses the development files of Wayland, xkbcommon, fontconfig and freetype, WPE WebKit for HTML pages, and a Vulkan driver.

The basic build command is:

cargo build --workspace --release

The full instructions for each platform are in the technical reference: https://github.com/nickalie/ngterm/blob/main/docs/development.md. It also has the tests, the architecture, the Android and iOS apps, and the release process.

To contribute:

Credits #

ngterm is a Rust port of agterm by Umputun. It uses:

The third-party notices are in https://github.com/nickalie/ngterm/blob/main/NOTICE.

License #

ngterm is released under the MIT License: https://github.com/nickalie/ngterm/blob/main/LICENSE.