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:
- 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.
- A workspace is a named group of sessions, usually for one project.
- A session is one row in the sidebar. It has a name, a working directory and an agent status.
- 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:
- A scratch terminal: a third terminal that covers the session. You can hide it and show it again, and its shell continues to run.
- An overlay: a temporary terminal or page on top of the session or on top of one pane. A program overlay closes when its program stops.
- A HUD: a small panel with a message on top of the session. You can type in the session under it.
- Companion sessions: ordinary sessions attached under a parent session in the sidebar, for example a log tail or a second shell for the same task.
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 #
| Word | Meaning |
|---|---|
| sidebar | The column at the left of a window, with the workspace rows and session rows. |
| title bar | The bar at the top of a window. It shows the session name and the buttons that you set in Settings ▸ Interface. |
| main menu | The 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 session | The session that is selected in a window. |
| agent status | The state that an agent reports: active, blocked or completed. The sidebar shows it as a glyph (see Agent status). |
| attention | A session asks for attention when its status is blocked or completed. |
| flag | A mark on a session. The flagged view shows only flagged sessions. |
| focus set | The workspaces that you mark. The workspace filter shows only these workspaces. |
| command palette | A searchable list of all commands. |
| Live sessions | The restore mode that keeps programs alive when ngterm quits (see Restore and Live sessions). |
ngtermctl | The 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.
| Platform | File | Kind |
|---|---|---|
| Debian, Ubuntu | ngterm_VERSION-1_amd64.deb, ngterm_VERSION-1_arm64.deb | System package |
| Fedora, openSUSE | ngterm-VERSION-1.x86_64.rpm, ngterm-VERSION-1.aarch64.rpm | System package |
| Arch Linux | ngterm-VERSION-1-x86_64.pkg.tar.zst, ngterm-VERSION-1-aarch64.pkg.tar.zst | System package |
| Linux, any distribution | ngterm-VERSION-linux-x86_64.AppImage, ngterm-VERSION-linux-aarch64.AppImage | AppImage |
| Linux, any distribution | ngterm-VERSION-linux-x86_64.tar.gz, ngterm-VERSION-linux-aarch64.tar.gz | Portable archive |
| Windows | ngterm-VERSION-windows-x86_64.msi | Installer for one user |
| Windows | ngterm-VERSION-windows-x86_64.zip | Portable archive |
| macOS | ngterm-VERSION-macos-arm64.dmg, ngterm-VERSION-macos-x86_64.dmg | Disk image |
| macOS | ngterm-VERSION-macos-arm64.pkg, ngterm-VERSION-macos-x86_64.pkg | Installer |
| macOS | ngterm-VERSION-macos-arm64.app.zip, ngterm-VERSION-macos-x86_64.app.zip | App bundle in a zip |
| macOS | ngterm-VERSION-macos-arm64.tar.gz, ngterm-VERSION-macos-x86_64.tar.gz | Binaries without a bundle |
| Android | ngterm-VERSION-android.apk | Signed app |
| iOS | ngterm-VERSION-ios-unsigned.ipa | Unsigned 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 #
| Platform | Requirements |
|---|---|
| Linux | x86_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. |
| Windows | x86_64. HTML pages use the Microsoft Edge WebView2 Runtime. Windows 11 includes it. Windows 10 can be without it. |
| macOS | macOS 14 or newer, on Apple silicon or Intel. A Mac with Metal. |
| Android | Android 8.0 or newer. |
| iOS | iOS 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:
- Make the file executable:
chmod +x ngterm-VERSION-linux-x86_64.AppImage. - 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:
- Extract the archive:
tar -xzf ngterm-VERSION-linux-x86_64.tar.gz. This makes a folder with the namengterm. - 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:
- Run
ngterm-VERSION-windows-x86_64.msi. - 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:
- Extract
ngterm-VERSION-windows-x86_64.zip. Keep thengtermfolder that it makes. - Run
ngterm\bin\ngterm.exe.
Install on macOS #
To install from the disk image:
- Open
ngterm-VERSION-macos-arm64.dmg(Apple silicon) orngterm-VERSION-macos-x86_64.dmg(Intel). - 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:
- Open ngterm. If macOS stops it, close the message.
- Open System Settings ▸ Privacy & Security.
- 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:
- Install the agent skill: the skill teaches Claude Code and Codex to drive ngterm.
- Install the agent status hooks: the hooks let an agent session report its status in the sidebar.
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:
- Click Install Update in the title bar, or select Help ▸ Check for Updates….
- 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 install | How the update installs |
|---|---|
.deb, .rpm, Arch package | Through 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 /Applications | Through the macOS installer. macOS asks for an administrator password. |
| AppImage | ngterm replaces the original AppImage file. |
Windows .msi | Through Windows Installer, without administrator rights. |
Portable archive, macOS app from the .dmg or the .app.zip | ngterm 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:
Put the download,
SHA256SUMSandSHA256SUMS.minisigin one folder.Verify the signature of the list:
minisign -Vm SHA256SUMS -x SHA256SUMS.minisig -P RWSX4LSrCmx6JMEuC+YIcKqnCodkV06ovAhb1umcA7Jcl0XOiecnn9ZPMake sure that the trusted comment is
ngterm vVERSION SHA256SUMS.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 --checkOn macOS, use this command:
grep " FILE$" SHA256SUMS | shasum -a 256 -cThe 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.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:
- Set Settings ▸ General ▸ Restore sessions to Fresh shells.
- Quit ngterm and start it again. This stops all detached Live session processes.
- Quit ngterm.
To remove ngterm:
| Install | How to remove it |
|---|---|
.deb | sudo apt remove ngterm |
.rpm | sudo dnf remove ngterm or sudo zypper remove ngterm |
| Arch package | sudo pacman -R ngterm |
| AppImage, portable archive | Delete the AppImage file or the ngterm folder. |
Windows .msi | Uninstall ngterm from the list of installed apps in Windows Settings. This also removes the PATH entry. |
| macOS | Move 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:
| Platform | Configuration | State |
|---|---|---|
| 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:
- Select Help ▸ Install Agent Status Hooks….
- Select Help ▸ Install Agent Skill….
- 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.
| Action | Linux and Windows | macOS |
|---|---|---|
| New session | CtrlShiftT | ⌘N |
| New workspace | CtrlShiftW | ⇧⌘N |
| New window | CtrlShiftN | ⌥⌘N |
| Close session | CtrlShiftQ | ⌘W |
| Split side by side | CtrlShiftD | ⌘D |
| Split top and bottom | CtrlShiftH | ⇧⌘D |
| Scratch terminal | CtrlShiftJ | ⌘J |
| Quick terminal | Ctrl` | ⌃` |
| Find in the terminal | CtrlShiftF | ⌘F |
| Terminal zoom | CtrlShiftEnter | ⇧⌘↩ |
| Dashboard | CtrlShiftM | ⇧⌘G |
| Go to a session | CtrlP | ⌃P |
| Command palette | CtrlShiftP | ⌃⇧P |
| Previous session, next session | CtrlShift↑, CtrlShift↓ | ⌥⌘↑, ⌥⌘↓ |
| Search the sessions in the sidebar | CtrlAltShiftF | No default key |
| Copy, paste | CtrlShiftC, CtrlShiftV | ⌘C, ⌘V |
| Settings | No 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.
- Open Settings ▸ General.
- Set Restore sessions to Live sessions.
- 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:
- Select Help ▸ Install Command Line Tool….
- 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 #
- Push CtrlShiftW (⇧⌘N on macOS) to make a workspace.
- Double-click the new workspace row.
- Type a name for the workspace.
- Push Enter.
- Right-click the workspace row.
- Select Open Directory….
- Select a project folder. ngterm opens a session in that folder.
- Start your agent in the session.
- 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 agent status glyph at the right (see Agent status).
- A line of information under the name, which an agent or a script sets with
ngtermctl session info. - A tint color on the icon, on the name or on both.
The footer of the sidebar has four buttons:
| Button | What it does |
|---|---|
| New Workspace | Makes 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 #
| Action | Linux and Windows | macOS | Menu |
|---|---|---|---|
| New session in the current workspace | CtrlShiftT | ⌘N | File ▸ New Session |
| New session in a folder that you select | CtrlShiftO | ⌘O | File ▸ Open Directory… |
| New session in the same folder, after the current one | No default key | No default key | File ▸ 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:
| Setting | Values |
|---|---|
| New sessions open in | Home directory, Current session’s directory or Custom directory |
| New sessions are added | At the end of the workspace or After the current session |
| Name sessions after the terminal title | On: the terminal title names a session. Off: the folder name names a session. |
| Default shell | The 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 #
- Shift-click a session row to select all session rows from the last row that you clicked.
- On Linux and Windows, Ctrl-click a session row to add it to the selection or to remove it.
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:
- Drop it on a workspace row to put it at the end of that workspace.
- Drop it on the upper half of a session row to put it before that session.
- Drop it on the lower half of a session row to put it after that session.
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 #
| Action | Linux and Windows | macOS | Menu |
|---|---|---|---|
| Close the session | CtrlShiftQ | ⌘W | File ▸ Close Session |
| Undo the last close | CtrlShiftZ | ⌘Z | File ▸ Reopen Closed Item |
| Reopen the last closed session or workspace | CtrlAltShiftT | ⇧⌘T | File ▸ Reopen Last Closed Item |
| Reopen an item from a list | No default key | No default key | File ▸ Open Recent |
| Delete the workspace | No default key | No default key | File ▸ 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.
| Action | Linux and Windows | macOS | Menu |
|---|---|---|---|
| Flag or unflag the session | CtrlShiftG | ⇧⌘F | View ▸ Flag Session |
| Show only flagged sessions | No default key | No default key | View ▸ Show Flagged Sessions |
| Flag or unflag a list of sessions | No default key | No default key | View ▸ Edit Flagged Sessions… |
| Unflag all sessions | No default key | No default key | View ▸ 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:
- Flat list: one list across workspaces, in an order that you set when you drag the rows.
- Flat list, names only: the same list, without the workspace names.
- Workspace tree: the flagged sessions under their workspaces.
Focus on some workspaces #
The focus set is a group of workspaces that you mark. The workspace filter then shows only these workspaces.
| Action | Menu |
|---|---|
| Show only the current workspace, or show all again | View ▸ Focus Workspace (or Unfocus Workspace) |
| Add the current workspace to the focus set | View ▸ Add Workspace to Focus |
| Apply the filter, or stop it | View ▸ Toggle Workspace Filter |
| Remove all workspaces from the focus set | View ▸ Clear Focus |
| Mark or unmark workspaces from a list | View ▸ 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.
| Action | Menu | What it makes |
|---|---|---|
| New companion | File ▸ New Companion | A shell in the folder of the parent. |
| Duplicate as companion | File ▸ Duplicate as Companion | A copy of the layout of the session, with a new copy of the program in each pane. |
| Convert to companion | File ▸ Convert to Companion | A 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:
- In the sidebar, a companion moves only among the companions of its parent. When you move the parent, its companions
move with it. To put a companion under a different parent, use
ngtermctl session move --parent. To make it a top-level session, use--top-level. - When you close a companion, only that companion closes. When you close the parent, all its companions close. One undo brings back the full group.
- If the shell of a parent stops while it has companions, a new shell starts in the same folder. If that shell stops in less than 2 seconds, the group closes.
- Click the arrow of the parent row to collapse its companions. A collapsed parent shows a marker when a hidden companion asks for attention.
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.
| Item | What it does |
|---|---|
| Clear Status | Sets the agent status of the session to idle. |
| Mark for Attention | Sets the status of an idle session to completed. |
| Rename | Starts a rename of the row. |
| Copy Name | Copies the session name to the clipboard. |
| Duplicate Session | Makes a new shell in the same folder, after the session. |
| New Session on host | For a remote session: makes a new session on that machine. |
| New Companion, Duplicate as Companion, Convert to Companion | See Companion sessions. |
| Move to | Moves the sessions to another workspace. |
| Flag, Unflag | Flags or unflags the sessions. |
| Tint | Sets the row color. |
| Reveal in Files | Opens 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 Session | Closes 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.
| Action | Linux and Windows | macOS | Menu |
|---|---|---|---|
| Split side by side, or hide the split | CtrlShiftD | ⌘D | View ▸ Toggle Vertical Split |
| Split top and bottom, or hide the split | CtrlShiftH | ⇧⌘D | View ▸ Toggle Horizontal Split |
| Focus the left (top) pane | CtrlShift← | ⌥⌘← | Navigate ▸ Focus Left Pane |
| Focus the right (bottom) pane | CtrlShift→ | ⌥⌘→ | Navigate ▸ Focus Right Pane |
| Exchange the two panes | No default key | No default key | View ▸ Swap Panes |
| Close the second pane | No default key | No default key | Command 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:
- Push CtrlShiftF (⌘F on macOS), or select View ▸ Find….
- Type the text. The bar shows the number of matches, for example
2 of 7. - Push Enter to go to the next match.
- Push ShiftEnter to go to the previous match.
- 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 #
| Action | Linux and Windows | macOS | Menu |
|---|---|---|---|
| Increase the font size | Ctrl= | ⌘ and the plus key | View ▸ Increase Font Size |
| Decrease the font size | Ctrl- | ⌘- | View ▸ Decrease Font Size |
| Reset the font size | Ctrl0 | ⌘0 | View ▸ 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:
| Action | Key |
|---|---|
| Scroll one page up, one page down | ShiftPage Up, ShiftPage Down |
| Go to the top, go to the bottom | ShiftHome, 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).
| Action | Linux and Windows | macOS | Menu |
|---|---|---|---|
| Hide all overlays of the session, or show them again | CtrlAltShiftJ | ⇧⌘J | View ▸ Hide Overlays (or Show Overlays) |
| Close the overlay on top | CtrlShiftQ | ⌘W | File ▸ 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.
| Action | Linux and Windows | macOS |
|---|---|---|
| Copy the selection | CtrlShiftC or CtrlInsert | ⌘C |
| Paste the clipboard | CtrlShiftV | ⌘V |
| Select all | CtrlShiftA | ⌘A |
| Paste the selection | Middle-click or ShiftInsert | Middle-click |
| Paste the clipboard with the mouse | Right-click | Right-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.
Links and file paths #
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.
| Click | What it does |
|---|---|
| Ctrl-click (⌘-click) a web address | Opens the link as Settings ▸ General ▸ Open links in tells: in your browser, or in a session overlay. |
| CtrlShift-click (⇧⌘-click) a web address | Opens the link in your browser, when the setting is a session overlay. |
| Ctrl-click (⌘-click) a file path | Opens 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 path | Shows 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.
Navigation #
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.
Navigation keys #
| Action | Linux and Windows | macOS | Menu |
|---|---|---|---|
| Go to a session by name | CtrlP | ⌃P | Navigate ▸ Go to Session |
| Command palette | CtrlShiftP | ⌃⇧P | Navigate ▸ Command Palette |
| Custom commands palette | CtrlAltShiftO | ⌃⇧O | Navigate ▸ Custom Commands |
| Sessions that ask for attention | CtrlShiftI | ⌃⇧I | Navigate ▸ Go to Attention… |
| Dashboard | CtrlShiftM | ⇧⌘G | Navigate ▸ Dashboard |
| Previous session | CtrlShift↑ | ⌥⌘↑ | Navigate ▸ Previous Session |
| Next session | CtrlShift↓ | ⌥⌘↓ | Navigate ▸ Next Session |
| Previous session that asks for attention | AltShift↑ | ⌃⌥↑ | Navigate ▸ Previous Attention Session |
| Next session that asks for attention | AltShift↓ | ⌃⌥↓ | Navigate ▸ Next Attention Session |
| First session, last session | No default key | No default key | Navigate ▸ First Session, Last Session |
| Previous workspace, next workspace | No default key | No default key | Navigate ▸ Previous Workspace, Next Workspace |
| Previous window, next window | No default key | No default key | Navigate ▸ Previous Window, Next Window |
| Recently used sessions | CtrlTab | ⌃Tab | None |
| Search the sessions in the sidebar | CtrlAltShiftF | No default key | View ▸ 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.
Use a palette #
A palette is a search field with a list of rows. It works the same in all modes:
- Open the palette with its key.
- Type a part of the name. The list shows the best matches first.
- Push ↑ and ↓, or CtrlK and CtrlJ, to move the selection.
- 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:
- Settings…
- Open Window: and the name of a closed window
- Move Session to and the name of a workspace
- Tint Session: and a color
- Close Split
- Your custom commands, with the badge
custom
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.
Switch to a recent session #
The session switcher walks through the sessions that you used most recently.
- Hold Ctrl.
- Push Tab one or more times. Push ShiftTab to go back.
- 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.
Search the sidebar #
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 field | What it does |
|---|---|
| ↑, ↓ | Moves the cursor to the previous or next match. |
| Enter | Opens the match under the cursor and gives the keyboard to its terminal. |
| Esc | Clears 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.
Go to the sessions that ask for attention #
A session asks for attention when its agent is blocked or completed. These tools find these sessions:
- The bell button in the title bar lists the sessions with an agent status in all open windows: blocked first, then active, then completed. The bell has a color while a session is blocked. Click a row to go to the session. The bell is off by default. To show it, set Settings ▸ Notifications ▸ Show attention indicator to on.
- Navigate ▸ Go to Attention… opens the same list in a palette.
- Previous Attention Session and Next Attention Session step through 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 #
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.
- Push CtrlShiftM (⇧⌘G on macOS), or click the dashboard button in the title bar.
- Push the arrow keys to move the highlight.
- 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.
Where you go after a close #
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 #
| Action | Linux and Windows | macOS | Menu |
|---|---|---|---|
| New window | CtrlShiftN | ⌥⌘N | File ▸ New Window |
| Open a window from the library | No default key | No default key | File ▸ Open Window |
| Rename the window | No default key | No default key | File ▸ Rename Window… |
| Delete the window | No default key | No default key | File ▸ Delete Window |
| Previous window, next window | No default key | No default key | Navigate ▸ Previous Window, Next Window |
| Full screen | F11 | ⌃⌘F | View ▸ Toggle Full Screen |
| Show or hide the sidebar | CtrlShiftS | ⌃⌘S | View ▸ 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:
| Button | What 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 terminal | Shows or hides the scratch terminal. |
| Split view | Shows or hides the split. |
| Hide overlays | Hides or shows the overlays of the session. Off by default. |
| Dashboard | Opens the dashboard. |
| Quick terminal | Shows or hides the quick terminal. |
| Custom commands | Lists your custom commands. Off by default. |
| Main Menu | Opens 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 #
| Status | Default glyph | Meaning | When it clears |
|---|---|---|---|
active | A light gray circle that pulses | The agent works on a turn. | You push Esc or CtrlC in the pane, or the agent sends a new status. |
blocked | An orange circle | The 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. |
completed | A green circle | The 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. |
idle | No glyph | No 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 #
| Agent | How it reports | Statuses it sends | File that the installer writes |
|---|---|---|---|
| Claude Code | Hooks | active, blocked, completed | ~/.claude/settings.json |
| Codex | Lifecycle hooks | active, blocked, completed | config.toml in $CODEX_HOME, by default ~/.codex/config.toml |
| Pi | Extension | active, completed | ~/.pi/agent/extensions/ngterm-status.ts |
Oh My Pi (omp) | Extension | active, completed | ~/.omp/agent/extensions/ngterm-status.ts |
| OpenCode 1 | Plugin | active, blocked, completed | ~/.config/opencode/plugins/ngterm-status.js |
| OpenCode 2 | Plugin | active, blocked, completed | plugins/ngterm-v2/tui.js in the OpenCode 2 configuration folder |
| Gemini CLI, Cursor Agent, Aider, Crush, Goose | Shell integration | active 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.
- Select Help ▸ Install Agent Status Hooks….
- If ngterm can not find the OpenCode version, select the version in the Choose OpenCode Version dialog.
- Read the result dialog. It shows the result for each agent.
- If you use Codex, start Codex and type
/hooks. - Review the ngterm hooks in Codex and approve them.
- If you use Pi, restart Pi or type
/reload. - If you use Oh My Pi or OpenCode, restart it.
- Open a new session. The shell integration starts only in a new shell.
- 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:
- Status hooks. They set the status of the session from the events of Claude Code.
- Restore hooks. In Re-run commands mode, they pin the pane to the current conversation. The next start of
ngterm then runs
claude --resumewith that conversation. See Restore and Live sessions. - Mail hooks. They give the messages from
ngtermctl msg sendto the agent in the pane. An idle agent wakes up when a message comes. - Chat hooks. They tell ngterm which conversation runs in the pane. The chat view of the phone apps uses this.
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 #
| Agent | Note |
|---|---|
| Claude Code | On Windows, the hooks run the PowerShell form of the scripts through powershell.exe. Windows PowerShell 5.1 is sufficient. |
| Codex | Codex runs a new hook only after you approve it with /hooks. |
| Codex | Codex 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. |
| Codex | The 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. |
| Codex | On 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. |
| Codex | If CODEX_HOME points to a different folder, the installer writes there. |
| Pi | Pi has no blocked status. |
| Oh My Pi | Only the top-level session reports. The status stays active while Oh My Pi continues a turn or runs background work. |
| OpenCode | OpenCode 2 reads its configuration folder from OPENCODE_CONFIG_DIR. The installer finds it from your login shell. |
| Shell integration | To 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.
- Run Help ▸ Install Agent Status Hooks… one time, so that the scripts are in
~/.config/ngterm/agent-status. - Open
~/.claude/settings.jsonin an editor. - Add one entry for each event in the table below.
- Start Claude Code again.
| Event | Matcher | Arguments to ngterm-claude-status.sh |
|---|---|---|
UserPromptSubmit | none | active --blink |
PostToolUse | none | active --blink |
Stop | none | completed --auto-reset |
PermissionRequest | none | blocked |
Notification | permission_prompt | blocked |
SessionEnd | none | completed --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.
- Run Help ▸ Install Agent Status Hooks… one time, so that the scripts are in
~/.config/ngterm/agent-status. - Open
config.tomlin$CODEX_HOME, by default~/.codex/config.toml. - Add the block below at the end of the file. Replace
/home/youwith your home folder. - Start Codex and type
/hooks. - 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 status | Effect |
|---|---|
--blink | The glyph pulses. |
--auto-reset | The status changes to idle when you visit the session. |
--if-idle | The status changes only if the session is idle now. |
--sound NAME | A sound plays when the status is set. default plays the system alert sound. |
--color #rrggbb | A different glyph color, for this status only. |
--shape NAME | A 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 scratch | The 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 #
| Action | Linux and Windows | macOS |
|---|---|---|
| Show the list of attention sessions (Go to Attention…) | CtrlShiftI | ⌃⇧I |
| Go to the next attention session | AltShift↓ | ⌃⌥↓ |
| Go to the previous attention session | AltShift↑ | ⌃⌥↑ |
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.
| Setting | Default | What it does |
|---|---|---|
| Active, Blocked, Completed | Gray, orange, green circles | The color and the shape of the glyph for each status. |
| Blocked sound | None | A sound that plays when a session becomes blocked. On Linux, each sound name plays the alert sound of the desktop. |
| Status reset | On first key | The key in the pane that clears a blocked or completed status: On first key, On Enter or Disabled. |
| Attention navigation includes active sessions | Off | The attention keys also stop on active sessions. |
| Attention navigation crosses windows | Off | The attention keys go to sessions in all open windows. |
| Auto-follow blocked sessions | Disabled | After 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 session | On | Auto-follow also leaves a session whose agent is active. |
| Reset to defaults | Not applicable | Sets 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:
- A banner from the notification system of your desktop.
- A badge on the session row in the sidebar. The badge counts the notifications that you did not see.
- A sound, if you set one.
The banner uses the native notification system of each platform:
| Platform | Banner |
|---|---|
| Linux | The freedesktop notification server of the desktop (org.freedesktop.Notifications) |
| Windows | A Windows toast notification |
| macOS | The macOS notification center |
Where notifications come from #
- A program in a pane sends a desktop notification with the OSC 9 or OSC 777 escape sequence.
- A script or an agent runs
ngtermctl notify. - ngterm reports a problem of its own, for example an error in
keymap.conforhooks.conf.
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 #
- If you click a banner, ngterm selects the session and gives the focus to the pane that sent it. The window comes to the front. If the window is closed, ngterm opens it again.
- Each pane has one banner. A new banner from the same pane replaces the old one.
- Each session has one more banner for
ngtermctl notify. A pane banner does not replace it. - When a pane of the session receives the focus, ngterm removes the banners of that session.
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
| Part | Meaning |
|---|---|
BODY | The text of the notification. It is necessary. |
--title | The title. The default is the name of the session. |
--target | The session that the notification belongs to. The default is active, the selected session of the front window. |
--window | The 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.
| Setting | Default | What it does |
|---|---|---|
| Show notification banners | On | Posts a banner for each notification. |
| Show notification badges | On | Shows the count of unseen notifications on the session row. When it is off, ngterm still counts them. |
| Badge reset | On first key | The key in the session that clears the badge: On first key, On Enter or Disabled. A visit to the session always clears it. |
| Notification sound | None | A 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 indicator | Off | Shows 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 #
| Kind | Open it with | What it shows | Page scripts | Page bridge |
|---|---|---|---|---|
| HTML file | --html FILE | A local HTML file | Only with --js | Yes |
| Web address | --url URL | An http or https address | Only with --js | No |
| Markdown | --markdown FILE | A .md or .markdown file, rendered in the terminal theme | No | No |
| Image | --image FILE | A png, jpg, gif or webp image | No | No |
| Text | --text FILE | A source, configuration, text or log file with line numbers | No | No |
| Clicked HTML file | A click on a .html or .htm path | A static copy of the file | No | No |
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:
| Action | Linux and Windows | macOS |
|---|---|---|
| Open a link or a file path | Ctrl + click | ⌘ + click |
| Open it while the program uses the mouse | CtrlShift + click | ⇧⌘ + click |
| Open a web link in the browser, not in an overlay | CtrlShift + click | ⇧⌘ + click |
| Show a local path in the file manager | CtrlAlt + click | ⌥⌘ + click |
| Show a local path in the file manager while the program uses the mouse | CtrlAltShift + click | ⌥⇧⌘ + click |
What a click on a local path opens:
| Path | Result |
|---|---|
.png, .jpg, .jpeg, .gif, .webp | An image page |
.md, .markdown | A Markdown page that follows links to the Markdown files next to it |
.html, .htm | A static HTML page, with no scripts, no file access and no network |
.log, .out | A log page that follows the end of the file |
.diff, .patch | A diff page |
path:line or path:line:column | A text page at that line |
| Other source, configuration and text files | A text page |
| Other files | ngterm 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 #
| Placement | Option | Result |
|---|---|---|
| Session overlay | none | The page covers the whole session. |
| Floating panel | --size-percent N | A framed panel at N percent of the session. Add --width and --height to set sizes in points. |
| One pane | --pane left or --pane right | The page covers one pane of a split. The other pane stays usable. |
| Page companion | --companion | A new sidebar row under the target session shows the page. |
| Page session | --page | A 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:
| Action | Linux and Windows | macOS |
|---|---|---|
| Hide or show the overlays | CtrlAltShiftJ | ⇧⌘J |
| Close the page | CtrlShiftQ | ⌘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
| Option | Effect |
|---|---|
--js | Lets the page run its own JavaScript. By default, page scripts are off. |
--cwd DIR | Lets the page read the files in DIR. The HTML file must be in DIR. ngterm refuses / and the home folder. |
--navigation | Adds Back, Forward, Reload, Open in Browser and Show in Files to the strip. |
--chromeless | Removes the strip. The page fills its panel. You can not use it with --navigation. |
--block | The command waits until the page gives an answer or closes. See The page bridge. |
--background-color #rrggbb | Sets 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
| Option | Effect |
|---|---|
--js | Lets the page run its JavaScript. Most web apps must have it. |
--persistent | Keeps cookies and site data in one saved store. A login then stays after you close the page or restart ngterm. |
--browse | Lets the page go to other sites. Without it, the page stays on its first site. |
--navigation | Adds Back, Forward, Reload, Open in Browser and Copy Link to the strip. |
--chromeless | Removes 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"
| Option | Effect |
|---|---|
--line N | Opens the file at line N and marks the line. |
--tail N | Shows only the last N lines (1 to 100,000). This makes a log page. |
--follow-file | Follows 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:
| Key | Action |
|---|---|
| /, or CtrlShiftF on Linux and Windows, or ⌘F on macOS | Go to the search field |
| n and N | Go to the next and the previous match |
| Esc | Clear the search |
| w | Wrap or unwrap long lines |
| F | Follow or pause a log page |
| G or End | Go to the bottom of a log page and follow it |
| g or Home | Go 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:
| Variable | Value |
|---|---|
--ngterm-background | The background color of the overlay |
--ngterm-foreground | The text color of the theme |
--ngterm-color-0 to --ngterm-color-15 | The 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 #
| Platform | Web engine |
|---|---|
| Linux | WPE 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. |
| Windows | Microsoft Edge WebView2 |
| macOS | WebKit (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:
- Tagged buttons and forms, with
data-ngtermattributes. They work when the page scripts are off. - The JavaScript function
ngterm.request(). It is available only in a page that you open with--js.
Which pages have the bridge #
| Page | data-ngterm controls | ngterm.request() |
|---|---|---|
--html FILE | Yes | No |
--html FILE --js | Yes | Yes |
--html FILE as a page companion or page session | Yes | Only with --js |
--url URL | No | No |
--markdown, --text, --image | No | No |
A clicked .html or .htm file | No | No |
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 #
| Attribute | Put it on | Meaning |
|---|---|---|
data-ngterm="COMMAND" | A button or a form | The command to send, by its socket name, for example session.select. |
data-ngterm-target="ID" | The same element | The target: a session, workspace or window id, a unique prefix of an id, or active. |
data-ngterm-args='{...}' | The same element | A JSON object with fixed arguments of the command. |
data-ngterm-into="SELECTOR" | The same element | An 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.
| Control | Value 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 name | Its value, as text |
| All other controls | Their 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.
| Member | Form | Result |
|---|---|---|
ngterm.request | ngterm.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. |
| Parameter | Type | Meaning |
|---|---|---|
command | string | The socket name of the command, for example tree, session.select or notify. |
target | string, optional | A session, workspace or window id, a unique prefix of an id, or active. |
args | object, optional | The 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:
| Command | Acts on |
|---|---|
session.* commands, but not session.new and session.go | The session of the page |
notify, font.inc, font.dec, font.reset, keymap.run | The session of the page |
ask.open in the terminal style | The session of the page |
The overlay commands of the page: session.overlay.close, reload, resize, navigate, submit, hide, show, toggle, follow, search, changes and wrap | The page itself, in its own pane |
window.close, select, rename, delete, resize, move, zoom, fullscreen, minimize | The window of the page |
hooks.reload, hooks.list, browser.clear, browser.links, recent.list, recent.clear | The whole app |
live.attach, live.attach.group, dashboard, recent.open | Their own ids, in the window of the page |
All other commands, for example tree | The 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 status | Output | Meaning |
|---|---|---|
| 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. |
| 1 | An error | The 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 #
| Mode | What comes back |
|---|---|
| Fresh shells (default) | The windows, workspaces, sessions, folders and split layout, with new shells. |
| Re-run commands | The 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 sessions | The 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:
- Open Settings ▸ General.
- Set Restore sessions to the mode.
- 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:
| Platform | Shells |
|---|---|
| Linux and macOS | zsh, bash, fish and PowerShell. Live sessions use your login shell, or the shell that the Ghostty command setting names. |
| Windows | PowerShell 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:
- Inline images.
- Prompt marks from before the attach.
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 #
| Event | Fresh shells | Re-run commands | Live sessions |
|---|---|---|---|
| You quit ngterm | New shells | The commands start again | The same processes come back |
| You update ngterm | New shells | The commands start again | The same processes come back |
| ngterm crashes, or you force it to quit | New shells | New shells, or the commands of the last ngtermctl restore capture | The same processes come back |
| An orderly restart of the computer | New shells | The commands start again | Each pane starts its last command again in a new live shell |
| A power loss | New shells | New shells, or the commands of the last ngtermctl restore capture | New shells |
To update ngterm with Live sessions on:
- Install the new version.
- Quit ngterm.
- 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:
- Its window was closed before the quit.
- A power loss or a force quit stopped ngterm before it could record the commands.
- The command is in
restore-denylist.conf, or it has a control character.
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.
| Command | What it does |
|---|---|
ngtermctl restore capture | Records 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 clear | Deletes all recorded commands. The next start opens plain shells. |
ngtermctl session restore COMMAND | Pins 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 #
| Command | What it does |
|---|---|
ngtermctl live list | Lists all live sessions and the panes that expect them. |
ngtermctl live screen NAME | Prints the screen of one live session, also for a pane in a closed window. |
ngtermctl live prune | Ends the live sessions that no pane claims and that have no attached client. |
ngtermctl live kill --target ID --pane left --force | Ends the live session of one pane and its process. |
ngtermctl live reset --force | Does 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:
- Panes with a live session that an earlier version of ngterm started.
- Panes with a live session that a session server of an earlier login started.
- Panes with a live session that no session server supervises.
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:
- Attach a remote session. One session from the remote machine becomes a row in your own sidebar, beside your local sessions.
- Open a remote window. A full window shows the sidebar of a server that runs
ngterm-headless, with all its workspaces and sessions.
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:
- Key-based ssh from your computer. ngterm runs ssh with no prompt, so a password prompt stops the connection.
ngtermctlon thePATHof ssh logins. The.deb,.rpm, Arch and Windows.msipackages do this. For other installs, linkngtermctlinto~/.local/binor/usr/local/bin, or select Help ▸ Install Command Line Tool… on that machine.- An ngterm that runs in Live sessions mode (Settings ▸ General ▸ Restore sessions set to Live sessions), or
ngterm-headless. Only a Live session can be attached. Live sessions mode is off by default. Refer to Restore and Live sessions.
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
| Line | What 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:HOST | Adds 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 = SECONDS | Sets how long ssh can try to reach every machine. The default is 10 seconds. The range is 1 to 300 seconds. |
connect-timeout DESTINATION = SECONDS | Sets 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 #
- Add the machine to
remotes.conf. - Select File ▸ Attach Remote…, or push CtrlShiftR (⇧⌘R on macOS).
- If
remotes.confhas more than one machine, select the machine in the picker. - 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:
| Row | What it does |
|---|---|
| Attach All | Attaches each session of the machine that is not attached yet. Companions go under their parent rows. |
| New Session | Creates 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:
- New Session on HOST creates a session on that machine and attaches it in the same workspace.
- End Session on HOST… closes the session on the remote machine, with its programs and its companions. You cannot undo this.
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.
- If ssh stops with an error, the pane shows a reconnect bar with the host name. ngterm connects again automatically.
- If the remote program stops, the pane shows the exit status and waits for a key.
- While the stream is down, the mirrored status, context, info line and HUD go away. They come back when the stream connects again.
- If the session is gone from the remote machine, the row stays with its last screen and does not try again.
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
| Option | What it does |
|---|---|
-p PORT | Uses this ssh port. |
-i FILE | Uses this ssh identity file. You can give more than one. |
-J HOST | Connects through this jump host. |
-F FILE | Uses this ssh config file. |
--from FILE | Installs 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 code | Meaning |
|---|---|
0 | The server is installed. |
3 | The server is installed, but the agent hooks are not. The output tells the reason. |
1 | The 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
| Option | What it does |
|---|---|
--detach | Starts the server in the background. The server continues to run after you log out. |
--grid COLUMNSxROWS | Sets the start size of each terminal. The default is 80x24. An attached viewer sets its own size. |
--install-agent-hooks | Installs or updates the agent skill and status hooks, then stops. |
--skip-agent-setup | Starts without a change to the agent skill and status hooks. |
--opencode-version v1 or v2 | Sets 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 #
- Add the server to
remotes.conf. - Select File ▸ Open Remote Window….
- If
remotes.confhas 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:
| Button | What it does |
|---|---|
| Detach | Hides the row on this computer only. The session continues on the server. |
| Terminate | Ends the session on the server. |
| Cancel | Does 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:
- The Windows OpenSSH server, with key-based ssh for your account.
ngtermctlon thePATHof ssh logins. The.msiinstaller adds it. A portable folder adds itself the first timengterm-headlessstarts there.
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:
- The agent chat view in the phone apps.
- Kitty clipboard paste.
- Renames that you make on that Mac.
- Page companions that the Mac opens later.
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 #
| Platform | Requirements | Install |
|---|---|---|
| Android | Android 8.0 or later | Download the .apk from the Releases page. Let your browser or file manager install apps, then open the file. |
| iOS and iPadOS | iOS 26 or later, iPhone or iPad | Download 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.
- 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.
- On the screen Add this key to your machines, tap Copy under Public key.
- On each machine, add the public key as a line of
~/.ssh/authorized_keysfor your user. - 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:
| Item | What it does |
|---|---|
| Show public key, Copy public key | Shows or copies the public key of this key. |
| Use for every machine | Makes all machines sign in with this key. |
| Export private key | Saves 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 key | Makes 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 key | Adds a key that you have. |
Add a machine #
- On the Machines screen, tap Add machine.
- Type the Host: a host name or an IP address.
- Type the User, the account that you sign in as.
- If ssh does not use port 22, change the Port.
- Optionally, type a Name for the list.
- Tap Save.
| Field | What it does |
|---|---|
| Name | The name in the list. Empty: the list shows the host. |
| Host, Port, User | The ssh destination. Put the user and the port in their own fields, not in the host. |
| Key | The key that signs in, when you have more than one. |
| Connection timeout | 3 to 60 seconds. Empty: the app uses the value from Settings ▸ Connections. |
| Pinned host key | The 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).
| Action | What it does |
|---|---|
| New session | Creates a session on the machine and attaches it. To give it a name, use New named session. |
| Attach | Shows the session in the app. |
| Detach | Removes the session from the app. The session continues on the machine. |
| Duplicate session | Makes a copy of the session on the machine. |
| Rename session | Changes the name of the session. |
| Chat view | Sets the chat view on or off for this session. |
| End session | Stops 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.
- If a different device drives the pane, tap Take control to type.
- If you paste text that can run a command, the app asks first.
- If a program asks to read your clipboard, the app asks you. Select Allow, Always allow on MACHINE or Deny.
- A question or a picker from an agent (
ngtermctl ask,ngtermctl pick) opens as a sheet over the session. - A HUD from the session shows as a banner at the top.
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:
- Type the prompt in the box. Type
/to see the commands and skills of the agent. - To add a photo, a video or a file, tap Attach a file. A file can be 32 MB or less.
- 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.
| Platform | When notifications come |
|---|---|
| Android | While 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. |
| iOS | While 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).
| Section | Settings |
|---|---|
| Terminal | Text 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). |
| Appearance | Light, dark, or the system mode. Android 12 and later also have Wallpaper colors. |
| Extra keys | Fit to the width, Always two lines, Hidden. |
| Connections | Connection timeout: 3 to 60 seconds, default 10. The value of a machine wins. |
| Agents | Agent chat view: on by default. |
| Notifications | Questions, Waiting for you, Finished, Agent notifications, Lost machines. Android also has App updates. |
| Clipboard | The machines that can read your clipboard without a question. Tap Ask again to remove one. |
| Keys | Refer to Set up the ssh key. |
| Diagnostics | Logs: 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. |
| About | The 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:
| Action | Keys |
|---|---|
| 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:
- On Linux and Windows, click the menu button at the right end of the title bar, then select Settings….
- On macOS, select Settings… in the app menu, or push ⌘,.
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
| Setting | Values | What it does |
|---|---|---|
| Scroll speed | 1x to 10x, default 3x | Sets how many lines one step of the mouse wheel scrolls. |
| Right-click pastes | On (default) or off | On: a right-click in a terminal pastes. Off: a right-click does nothing. |
| Open links in | Browser (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 collapse | On (default) or off | On: a click on a workspace row in the sidebar opens or closes the workspace. |
Sessions
| Setting | Values | What it does |
|---|---|---|
| New sessions open in | Home directory (default), Current session’s directory, Custom directory | Sets the start folder of a new session. For Custom directory, click Choose… to select the folder. |
| Name sessions after the terminal title | Off (default) or on | On: 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 added | At the end of the workspace (default), After the current session | Sets where a new session goes in the sidebar. |
| Default shell | Config / system default, then each shell that ngterm finds | Sets 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 sessions | Fresh shells (default), Re-run commands, Live sessions | Sets 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 session | Off (default) or on | On: ngterm asks before it closes a session. |
| Allow undo after closing sessions and workspaces | On (default) or off | On: you can reopen a closed session or workspace for a short time. |
| Flagged view layout | Flat list (default), Flat list, names only, Workspace tree | Sets how the sidebar arranges the flagged sessions. |
| Use my global Ghostty config | Off (default) or on | On: 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
| Setting | Values | What it does |
|---|---|---|
| Automatically download updates | On (default) or off | On: 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
| Setting | Values | What it does |
|---|---|---|
| Font name | Default, then each monospaced font on your system | Sets the terminal font. Default uses the font from the Ghostty config. |
| Font size | 8 to 32, default 13 | Sets the terminal font size in points. |
| Cursor shape | Default, Block, Bar, Underline | Sets the cursor shape. Default uses the shape from the Ghostty config. |
| Cursor blink | Default, Blink, Steady | Sets if the cursor blinks. With Default, a program can start or stop the blink. |
| Theme | default ghostty, then the bundled themes | Sets the terminal colors. default ghostty is the built-in Ghostty colors. |
| Follow system appearance | Off (default) or on | On: ngterm uses one theme in light mode and a second theme in dark mode. |
| Light theme or Dark theme | The bundled themes | Shows when Follow system appearance is on. Sets the theme of the other mode. |
Window
| Setting | Values | What it does |
|---|---|---|
| Toolbar | Normal, Compact (default), Hidden | Sets the title bar: the session name over a second line, one short row, or no row. |
| Background Opacity | 0% to 100%, default 100% | Makes the window background transparent. |
| Background Blur | 0 to 100, default 0 | Blurs what is behind a transparent window. It works only when the opacity is less than 100%. |
| Ignore Reduce Transparency | Off (default) or on | On: the window uses the opacity and blur also when the system asks for less transparency. |
| Sidebar Tint | Lighter 5 to Darker 5, default None | Makes the sidebar background lighter or darker than the terminal background. |
| Sidebar font size | 9 to 20, default 13 | Sets the text size of the sidebar rows. |
| Sidebar density | Default, Compact | Compact makes the sidebar rows closer together. |
| Palette and switcher font size | 9 to 20, default 13 | Sets the text size of the palettes and the session switcher. |
| Inactive pane and backdrop mute | 0 to 10, default 5 | Sets 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
| Toggle | Default | Control |
|---|---|---|
| Workspace name | Off | The name of the current workspace. |
| Session name | On | The name of the current session. |
| Window name | On | The name of the window. |
| Session context | On | The context text of the session. |
| Sidebar toggle | On | The button that shows or hides the sidebar. |
| Remote host | On | The host of an attached remote session. |
| Recent sessions | On | The button that lists the sessions you used most recently. |
| Scratch terminal | On | The scratch terminal button. |
| Split view | On | The split button. |
| Hide overlays | Off | The button that hides and shows the overlays. |
| Dashboard | On | The dashboard button. |
| Quick terminal | On | The quick terminal button. |
| Custom commands | Off | The custom commands button. |
Sidebar
| Toggle or setting | Default | What it does |
|---|---|---|
| New workspace | On | Shows the new workspace button. |
| New session | On | Shows the new session button. |
| Flagged view | On | Shows the flagged view button. |
| Workspace filter | On | Shows the workspace filter button. |
| Workspace add-session | On | Shows the add-session button on a workspace row. |
| Workspace icons | On | Shows workspace icons. |
| Session icons | On | Shows session icons. |
| Workspace chevrons | On | Shows the chevron that opens and closes a workspace. |
| Session info | Always | Sets when a session row shows its info line: Always, Flagged (flagged sessions only) or Off. |
| Active window only | Off | On: only the window that has the keyboard shows its sidebar. |
Quick Terminal
| Setting | Values | What it does |
|---|---|---|
| Size | Default, or 40% to 90% of the screen in steps of 10% | Sets the size of the quick terminal. |
Notifications #
| Setting | Values | What it does |
|---|---|---|
| Show notification banners | On (default) or off | On: ngterm shows desktop notifications. |
| Show notification badges | On (default) or off | On: a session row shows a badge for its notifications. |
| Badge reset | On first key (default), On Enter, Disabled | Sets when a badge goes away: at the first key in the session, at Enter, or never. |
| Bounce Dock icon | None (default), Once, Until focused | This version keeps the value, but does not use it. |
| Notification sound | None, or a sound name | Plays 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 indicator | Off (default) or on | On: the title bar shows an indicator when a session waits for you. |
Refer to Notifications.
Agent Status #
| Setting | Values | What it does |
|---|---|---|
| Active, Blocked, Completed | A color and a shape | Sets 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 sound | None, or a sound name | Plays a sound when an agent becomes blocked. |
| Status reset | On first key (default), On Enter, Disabled | Sets when typing in a session clears its status glyph. |
| Attention navigation includes active sessions | Off (default) or on | On: the keys that go to the next session that waits for you also stop at active sessions. |
| Attention navigation crosses windows | Off (default) or on | On: these keys also go to sessions in other windows. |
| Auto-follow blocked sessions | Disabled (default), 5 sec idle, 10 sec idle, 30 sec idle, 60 sec idle, 5 min idle | When you do not type for this time, ngterm selects a session that is blocked. |
| Auto-follow away from a running session | On (default) or off | Off: 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 #
| Item | What it does |
|---|---|
| Lock in ngterm | Selects 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 Directory | Shows 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. |
| Diagnostics | Shows the problems in keymap.conf. Click Reload to read the file again. |
| Hooks | Shows 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:
- Select File ▸ Edit ghostty.conf…. The file opens in your editor in an overlay.
- 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:
- The Ghostty defaults, and the ngterm defaults below.
- Your global Ghostty config, only when Settings ▸ General ▸ Use my global Ghostty config is on. On Linux and
macOS, this is
~/.config/ghostty/configand~/.config/ghostty/config.ghostty. On Windows, it is in%LOCALAPPDATA%\ghostty. ghostty.confin the ngterm config folder.- 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:
| Setting | Ghostty key | When Settings writes it |
|---|---|---|
| Font name | font-family | When it is not Default. |
| Font size | font-size | When you set a size. |
| Theme, Light theme, Dark theme | theme | When it is not default ghostty. |
| Cursor shape | cursor-style | When it is not Default. |
| Cursor blink | cursor-style-blink | When it is not Default. |
| Scroll speed | mouse-scroll-multiplier | Always. |
| Right-click pastes | right-click-action | Always: 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:
| Area | Keys |
|---|---|
| Colors | theme, background, foreground, palette, background-opacity, split-divider-color |
| Font | font-family, font-family-bold, font-family-italic, font-family-bold-italic, font-feature, font-size |
| Cursor | cursor-style, cursor-style-blink, cursor-color, cursor-text, cursor-opacity, cursor-click-to-move, cursor-invert-fg-bg |
| Selection | selection-foreground, selection-background, selection-clear-on-typing, selection-clear-on-copy, selection-word-chars, selection-invert-fg-bg, copy-on-select |
| Background image | background-image, background-image-opacity, background-image-position, background-image-fit, background-image-repeat |
| Padding | window-padding-x, window-padding-y, window-padding-balance, window-padding-color |
| Clipboard | clipboard-read, clipboard-write, clipboard-write-limit-bytes, clipboard-trim-trailing-spaces, clipboard-paste-protection, clipboard-paste-bracketed-safe, clipboard-codepoint-map |
| Mouse | mouse-hide-while-typing, mouse-shift-capture, mouse-reporting, mouse-scroll-multiplier, right-click-action, middle-click-action, click-repeat-interval, focus-follows-mouse |
| Scrollback | scrollback-limit-bytes, scrollback-limit-lines |
| Programs | command, env, input, working-directory, shell-integration, shell-integration-features, wait-after-command, abnormal-command-exit-runtime, term |
| Other | keybind, 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:
- Font metrics and styles:
adjust-*,font-style*,font-variation*,font-synthetic-style,font-codepoint-map,font-shaping-break,freetype-load-flags,font-thicken*. - Rendering:
bold-color,faint-opacity,minimum-contrast,alpha-blending,background-opacity-cells,palette-generate,palette-harmonious,search-*colors,custom-shader*,background-blur. - Behavior:
scroll-to-bottom,scrollback-compression,link,link-osc8,key-remap,desktop-notifications,initial-command,enquiry-response,osc-color-report-format,title-report,vt-kam-allowed. - Window and app keys of the Ghostty app:
window-*size, position, decoration and theme keys,gtk-*,macos-*(exceptmacos-option-as-alt),quick-terminal-*,bell-*,unfocused-split-*,confirm-close-surface,notify-on-command-finish*,auto-update*,fullscreen,maximize.
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:
- Select View ▸ Select Theme…. This palette shows the selected theme on your terminals at once. Move through the list with the arrow keys, then push Enter to keep the theme.
- Select the theme in Settings ▸ Appearance ▸ Theme.
- Run
ngtermctl theme set NAME. To see the names, runngtermctl theme list.
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:
- Give a different key to a built-in action.
- Add custom commands: shell lines that a key or the palette starts.
- Set one system-wide key that opens the quick terminal from any app.
Edit the keymap #
- Select File ▸ Edit Keymap…. The file opens in your editor in an overlay over the session.
- 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:
- On Linux and macOS:
$VISUAL, then$EDITOR, thenvi. ngterm reads them from your login shell, so you must export them. - On Windows:
VISUAL, thenEDITOR, then Notepad.
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
| Verb | Format | What it does |
|---|---|---|
map | map CHORD [--repeat] ACTION | Gives a built-in action this key. The key replaces the default key of the action. |
command | command "NAME" [CHORD] [--repeat] [ERROR OPTIONS] SHELL LINE | Adds a custom command. Without a chord, the command is in the palette only. |
global-hotkey | global-hotkey CHORD | Sets one system-wide key that shows the quick terminal. A second line replaces the first. |
A chord is modifiers and one key, joined by +:
| Part | Values |
|---|---|
| Modifiers | ctrl (or control), shift, opt (or option, alt), cmd (or command). On Linux and Windows, cmd is the Super key. |
| Keys | One 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:
- Leader sequences. Join chords with
>to make a sequence, for examplectrl+a>g. Push the chords one after the other, in 1.5 seconds. - Alternatives. Join two or more chords with
|, with no spaces. Each alternative starts the action. - Repeat. With
--repeatafter the chord, the last chord of a leader sequence fires again alone for 0.5 seconds after you release it. This is the same asbind -rin tmux. - Modifier first. A custom command key, and each key after the first alternative of a
mapline, must start with a modifier or a function key. - No bare arrows. A
mapline cannot use an arrow key without a modifier. - Reserved keys. CtrlTab (the session switcher), Ctrl1 and Ctrl2 (the two panes of a split) cannot be bound.
- Conflicts. If two bindings use the same key, ngterm drops one and shows a diagnostic. A custom command that loses its key stays in the palette.
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.
| Platform | How ngterm registers the key |
|---|---|
| macOS | A system hotkey, by physical key position. |
| Windows | A system hotkey. |
| Linux on X11 | A key grab. |
| Linux on Wayland | The 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.
| Action | keymap.conf name | Linux and Windows | macOS |
|---|---|---|---|
| New Window | new_window | CtrlShiftN | ⌥⌘N |
| Rename Window… | rename_window | – | – |
| Delete Window | delete_window | – | – |
| Previous Window | previous_window | – | – |
| Next Window | next_window | – | – |
| New Workspace | new_workspace | CtrlShiftW | ⇧⌘N |
| Rename Workspace | rename_workspace | – | – |
| Delete Workspace | delete_workspace | – | – |
| New Session | new_session | CtrlShiftT | ⌘N |
| Open Directory… | open_directory | CtrlShiftO | ⌘O |
| Rename Session | rename_session | – | – |
| Duplicate Session | duplicate_session | – | – |
| New Companion | new_companion | – | – |
| Duplicate as Companion | duplicate_companion | – | – |
| Convert to Companion | convert_companion | – | – |
| Close Session | close_session | CtrlShiftQ | ⌘W |
| Reopen Last Closed Item | reopen_recent | CtrlAltShiftT | ⇧⌘T |
| Reopen Closed Item (undo a close) | undo_close | CtrlShiftZ | ⌘Z |
| Clear Status | clear_status | – | – |
| Increase Font Size | increase_font_size | Ctrl= | ⌘+ |
| Decrease Font Size | decrease_font_size | Ctrl- | ⌘- |
| Actual Size | reset_font_size | Ctrl0 | ⌘0 |
| Toggle Vertical Split | toggle_split | CtrlShiftD | ⌘D |
| Toggle Horizontal Split | toggle_horizontal_split | CtrlShiftH | ⇧⌘D |
| Show or Hide Scratch | toggle_scratch | CtrlShiftJ | ⌘J |
| Toggle Terminal Zoom | toggle_terminal_zoom | CtrlShiftEnter | ⇧⌘↩ |
| Show or Hide Overlays | toggle_overlay | CtrlAltShiftJ | ⇧⌘J |
| Find… | toggle_search | CtrlShiftF | ⌘F |
| Show or Hide Sidebar | toggle_sidebar | CtrlShiftS | ⌃⌘S |
| Select Theme… | select_theme | – | – |
| Toggle Full Screen | toggle_fullscreen | F11 | ⌃⌘F |
| Show Flagged Sessions | toggle_flagged_view | – | – |
| Flag Session | toggle_flag | CtrlShiftG | ⇧⌘F |
| Focus Workspace | focus_workspace | – | – |
| Toggle Workspace Filter | toggle_workspace_filter | – | – |
| Previous Workspace | previous_workspace | – | – |
| Next Workspace | next_workspace | – | – |
| Collapse Workspace | toggle_workspace_collapse | – | – |
| Focus Left Pane | focus_left_pane | CtrlShift← | ⌥⌘← |
| Focus Right Pane | focus_right_pane | CtrlShift→ | ⌥⌘→ |
| Previous Session | previous_session | CtrlShift↑ | ⌥⌘↑ |
| Next Session | next_session | CtrlShift↓ | ⌥⌘↓ |
| Previous Attention Session | previous_attention_session | AltShift↑ | ⌃⌥↑ |
| Next Attention Session | next_attention_session | AltShift↓ | ⌃⌥↓ |
| First Session | first_session | – | – |
| Last Session | last_session | – | – |
| Quick Terminal | quick_terminal | Ctrl` | ⌃` |
| Go to Session (session palette) | session_palette | CtrlP | ⌃P |
| Command Palette | command_palette | CtrlShiftP | ⌃⇧P |
| Custom Commands (palette) | custom_command_palette | CtrlAltShiftO | ⌃⇧O |
| Show Attention | show_attention | CtrlShiftI | ⌃⇧I |
| Dashboard | dashboard | CtrlShiftM | ⇧⌘G |
| Attach Remote… | attach_remote | CtrlShiftR | ⇧⌘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_search | CtrlAltShiftF | – |
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:
- Copy, paste and select all come from the Ghostty config: CtrlShiftC, CtrlShiftV and
CtrlShiftA on Linux and Windows, ⌘C, ⌘V and ⌘A on
macOS. To change them, use
keybindlines inghostty.conf. - CtrlTab opens the session switcher.
- Ctrl1 and Ctrl2 move the keyboard to the first or the second pane of a split.
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:
- Push its key.
- Open the custom commands palette with CtrlAltShiftO (⌃⇧O on macOS), then select the command.
- Select the command in the command palette. It has the mark
custom. - Run
ngtermctl keymap run "NAME".
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:
| Option | What it does |
|---|---|
--error-hud | Shows a panel with the command name, the exit status and the last error line. |
--error-position POS | Sets 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 right | Puts 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.
| Variable | Value |
|---|---|
AGT_SESSION_ID | The ID of the session. |
AGT_SESSION_NAME | The name of the session. |
AGT_SESSION_PWD | The current folder of the pane. |
AGT_SESSION_HOST | The ssh destination of an attached remote session. Empty for a local session. |
AGT_WORKSPACE_ID | The ID of the workspace. |
AGT_WORKSPACE_NAME | The name of the workspace. |
AGT_WINDOW_ID | The ID of the window. |
AGT_WINDOW_NAME | The name of the window. |
AGT_PANE | The pane: left (the main pane), right (the split pane) or scratch. |
AGT_PANE_ID | The token of the pane, the same value as NGTERM_PANE_ID in its shell. |
AGT_SELECTION | The selected text. |
AGT_SOCKET | The 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 #
- Select File ▸ Edit Hooks…. The file opens in your editor in an overlay.
- 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 #
| Kind | When it fires |
|---|---|
status | The agent status of a session changes: idle, active, blocked or completed. A change of only the blink, pane, color or shape also fires. |
notify | A session posts a notification. It also fires when desktop banners are off. |
session.created | A session comes into a window. A companion also gives its parent. |
session.closed | A session leaves a window. |
session.selected | The selected session of a window changes. |
tree.changed | Names, 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.split | The split pane shows or hides. |
pane.scratch | The scratch terminal shows or hides. |
pane.focused | The keyboard goes to the other pane of a split. |
remote.opened | A row of an attached remote session comes into a window. |
remote.closed | A row of an attached remote session leaves a window. |
app.launched | ngterm started. It fires once for each start, when the control socket is ready. |
message | ngterm 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.
| Variable | Value |
|---|---|
AGT_EVENT_KIND | The event kind, for example status. |
AGT_EVENT_STATUS | The status of a status event, or shown or hidden for pane.split and pane.scratch. |
AGT_EVENT_HOST | The ssh destination of a remote session. |
AGT_SESSION_ID | The session ID. |
AGT_WORKSPACE_ID | The workspace ID. |
AGT_WINDOW_ID | The window ID. |
AGT_SOCKET | The 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 #
- The shell line runs with
/bin/sh -con Linux and macOS, and withcmd.exe /D /S /Con Windows. It runs without a terminal, in the working folder of ngterm, with the samePATHas a custom command. - Each hook runs one process at a time. Next events for that hook wait in order. When 256 events wait, ngterm drops the oldest.
- There is no time limit.
- If a hook exits with an error, ngterm shows one banner. It shows the banner again only after the hook succeeds or you reload the file.
- When you reload, a line that did not change keeps its running process and its events.
Files and folders #
ngterm keeps your config files in the config folder, and its own data in the state folder.
| Folder | Linux and macOS | Windows |
|---|---|---|
| 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.
| File | What it holds |
|---|---|
keymap.conf | Keys and custom commands. Refer to Keys and custom commands. |
hooks.conf | Event hooks. Refer to Event hooks. |
ghostty.conf | Terminal settings in the Ghostty format. Refer to Ghostty config and themes. |
remotes.conf | Remote machines and connection timeouts. Refer to Remote machines. |
restore-denylist.conf | Programs 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 folder | What it holds |
|---|---|
settings.json | The values from Settings. |
ngterm.log | The log. At start, when the log is larger than 8 MB, ngterm moves it to ngterm.log.1. |
ngterm.sock | The control socket. On Windows, ngterm uses a named pipe and no file is there. |
windows.json, windows/ | Your windows, workspaces and sessions. |
recent-closed.json | The closed sessions and workspaces that you can reopen. |
ghostty-settings.conf | The 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:
| File | Linux and macOS | Windows |
|---|---|---|
| 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:
| Variable | Value |
|---|---|
NGTERM_ENABLED | 1. The shell runs in ngterm. |
NGTERM_SESSION_ID | The ID of the session. |
NGTERM_WINDOW_ID | The ID of the window. |
NGTERM_WORKSPACE_ID | The ID of the workspace where the shell started. It does not change when you move the session. |
NGTERM_SOCKET | The control socket of this ngterm. Give it to ngtermctl as --socket "$NGTERM_SOCKET". |
NGTERM_PANE | The pane where the shell started: left, right or scratch. |
NGTERM_PANE_ID | A token for the pane. It stays with the pane when panes swap. |
NGTERM_LIVE_SESSION, NGTERM_LIVE_DIR | Set in a pane that runs as a Live session. |
TERM_PROGRAM | ngterm. |
TERM_PROGRAM_VERSION | The ngterm version. |
TERM | xterm-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:
| Variable | What it does |
|---|---|
NGTERM_STATE_DIR | Uses a different state folder. The config folder becomes its config subfolder. |
NGTERM_CONTROL_SOCKET | Uses a different path for the control socket of the app. |
NGTERM_LOG | Sets 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:
- The path in the
--socketflag. ngterm.sockin the folder thatNGTERM_STATE_DIRnames.- The default socket:
~/.local/share/ngterm/ngterm.sockon Linux and macOS ($XDG_DATA_HOME/ngtermwhenXDG_DATA_HOMEis set), and%LOCALAPPDATA%\ngterm\ngterm.sockon 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:
| Command | Runs |
|---|---|
ngtermctl session split | session split visibility |
ngtermctl session hud | session hud open |
ngtermctl quick | quick visibility |
ngtermctl sidebar | sidebar visibility |
ngtermctl pick | pick open |
ngtermctl ask | ask 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:
- A change prints
ok. - A create command (
session new,session duplicate,workspace new,window new) prints the new id. - A batch close or move prints the number of sessions that it changed.
treeandwindow listprint a listing.- A refusal prints
error: MESSAGEon standard error, for exampleerror: no such session: 3f2a.
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 #
| Code | Meaning |
|---|---|
0 | The command succeeded. |
1 | The app refused the request, the connection failed, or a result is still pending. |
2 | The 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. |
3 | ask: the user pushed Esc, closed the dialog or selected the --cancel button. server install: the server is installed, but the agent hooks are incomplete. |
64 | Usage error: an unknown flag, a missing argument or a bad value. |
124 | session wait or msg read --wait: the --timeout passed first. |
| other | session 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:
| Value | Selects |
|---|---|
active (default) | The selected session, or the current workspace, of the window. |
| a full id | The session or workspace with that UUID. Case is not important. |
| a unique prefix | The 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.
--window ID|prefix|activeselects the window whose tree a command acts on. The default is the frontmost window. Without--window, an id or a prefix matches sessions in all open windows.windowcommands take the window as a positional argument, with the defaultactive.session close,session moveandsession detachaccept more than one--targetfor a batch.--paneselects one pane of a session:primary(alsoleftortop),split(alsorightorbottom), orscratch.--pane-id "$NGTERM_PANE_ID"selects a pane by its stable token. The token follows the pane when it moves to the other side.surfacecommands take a surface id from thesurfacesoftree --json,quickfor the quick terminal, oractive. A surface id has the formsurface:SESSION-ID:KIND.KINDisleft,right,scratch,overlay,overlay-leftoroverlay-right.
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.
| Flag | Use |
|---|---|
--kind KIND | Print only these kinds. Repeat the flag, or separate the kinds with commas. |
--run UUID --after SEQ | Continue from a cursor. Use the two flags together. |
--limit N | Events in each read, from 1 to 1000 (default 100). |
--json | Print 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.
| Kind | When it occurs |
|---|---|
status | The agent status of a session changes: idle, active, completed or blocked. A change of blink, pane, color or shape counts too. |
notify | ngterm accepts a notification for a session. It occurs also when desktop banners are off. |
session.created | A session comes into a window. A companion also has parent. |
session.closed | A session goes out of a window. |
session.selected | The selected session of a window changes. |
tree.changed | A name, an order or a member changes, or an overlay, page or HUD opens or closes. Read tree --json for the new state. |
pane.split | A split is shown or hidden. |
pane.scratch | A scratch terminal is shown or hidden. |
pane.focused | The focused pane of a split session changes. |
remote.opened | A session that live attach made comes into the tree. |
remote.closed | That session goes out of the tree. |
app.launched | ngterm started, loaded hooks.conf and accepts connections. It occurs once in each run. |
message | A 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 #
| Subcommand | Does | Main flags |
|---|---|---|
new [NAME] | Creates a workspace and prints its id. | --collapsed, --tint COLOR, --tint-on icon|name|icon,name |
rename NAME | Renames a workspace. | --target |
delete | Deletes a workspace. | --target |
select | Selects a workspace. | --target |
go | Goes to the next or previous workspace. | --to next|prev |
move | Moves 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, expand | Collapses or expands a workspace in the sidebar. | --target |
tint VALUE | Colors the row of the workspace, or removes the color with clear. | --on icon|name|icon,name |
detach | Hides a workspace of a remote window here. Its sessions continue on the server. | --target |
reattach | Shows 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 #
| Subcommand | Does | Main flags |
|---|---|---|
new | Creates 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 |
duplicate | Starts a new shell in the directory of a session, after it. | --companion, --no-select |
close | Closes one or more sessions. | --target (repeat for a batch), --undoable, --terminate |
undo | Brings back a session that close --undoable closed, while the undo time lasts. | --target UNDO-ID (necessary) |
select | Selects a session. | --target |
go | Goes to another session. | --to next|prev|first|last|next-attention|prev-attention|N |
rename NAME | Renames a session. | --target |
reveal | Opens 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 TEXT | Sets the text that the title bar shows for the session, or removes it with --clear. | --clear |
info TEXT | Sets the info line under the sidebar row, or removes it with --clear. | --markdown, --hide-after SECONDS, --clear |
tint VALUE | Colors the sidebar row, or removes the color with clear. | --on icon|name|icon,name |
seen | Clears the unseen-notification badge. It does not change the selection. | --target |
collapse, expand | Folds or unfolds the companions of a parent session in the sidebar. | --target |
convert | Makes a session a companion of a new session in its place, and prints the new id. | --companion |
detach | Hides sessions of a remote window here. They continue on the server. | --target (repeat) |
reattach | Shows 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 #
| Subcommand | Does | Main flags |
|---|---|---|
split [MODE] | Shows or hides the split: on, off or toggle (default). A hidden pane continues to run. | --axis vertical|horizontal |
split close | Closes the split pane and stops its program. | --target |
swap | Exchanges the two panes of a split session. | --target |
focus [PANE] | Focuses primary, split, or the other pane (default). | --target |
resize | Moves 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 |
lead | Makes this computer the leader of a pane of an attached session, so the program uses its window size. | --pane |
restart | Replaces 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 COMMAND | Sets 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 #
| Subcommand | Does | Main flags |
|---|---|---|
type TEXT | Types text into a pane. A newline in the text pushes Enter. | --stdin, --pane, --pane-id, --select |
paste | Pastes the system clipboard into a pane. | --pane |
copy | Prints the selected text. It does not change the clipboard. | --target |
select-all | Selects all the text of the terminal. | --target |
text | Prints 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 #
| Subcommand | Does | Main flags |
|---|---|---|
status STATE | Sets the status glyph: idle, active, completed or blocked. | --blink, --auto-reset, --if-idle, --sound NAME, --color #rrggbb, --shape SHAPE, --pane, --pane-id |
wait | Waits 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 #
| Subcommand | Does | Main flags |
|---|---|---|
background image PATH | Shows a PNG or JPEG image behind the terminal. | --opacity 0..1, --fit contain|cover|stretch|none, --position, --repeat, --pane |
background text TEXT | Shows text as a watermark behind the terminal. | --color, --opacity, --fit, --position, --pane |
background color #rrggbb | Sets a solid background color. | --pane |
background clear | Removes 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.
| Subcommand | Does | Main 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 close | Closes the overlay. | --pane |
overlay hide, show, toggle | Hides the overlays, or shows them again. A hidden overlay continues to run. | --pane |
overlay resize | Changes the size of an open overlay. | --size-percent N, --width, --height, --full |
overlay result | Prints the exit status of the program, or the outcome of a page. | --pane, --page ID |
overlay submit | Answers a page with a value and closes it. | --value TEXT |
overlay copy | Prints the text that is selected in the overlay. | --pane |
overlay text | Prints the text of the overlay terminal. | --all, --lines N, --pane |
overlay reload | Loads the HTML page again. | --current |
overlay navigate STEP | Goes back or forward, opens the page in the browser, or shows its file in the file manager (finder). | --pane |
overlay follow MODE | Follows the end of a log page, or stops: on, off or toggle. | --pane |
overlay search TEXT | Searches a text or log page. | --next, --prev, --close |
overlay changes | Goes to the next or previous change of a diff page. | --next, --prev |
overlay wrap MODE | Wraps the long lines of a text page: on, off or toggle. | --pane |
More flags of overlay open:
| Flag | Use |
|---|---|
--line N | With --text, open at line N and mark it. |
--tail N | With --text, show only the last N lines. |
--follow-file | With --text, follow the end of the file as it grows. |
--navigation | With --html or --url, add the back, forward, reload and browser buttons. |
--js | With --html or --url, let the page run its own JavaScript. |
--chromeless | With --html, or --url on localhost, 127.0.0.1 or ::1, show the page without the title strip of ngterm. |
--persistent | With --url, keep cookies and site data, so that a login stays after a restart. |
--browse | With --url, let the page go to other sites. |
--cwd DIR | With --html, let the page read files in this directory. |
--background-color #rrggbb | Set 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.
| Subcommand | Does | Main flags |
|---|---|---|
hud open MESSAGE | Shows 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 MESSAGE | Replaces 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 close | Removes 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 #
| Subcommand | Does | Main flags |
|---|---|---|
zoom [MODE] | Zooms a terminal surface to fill the window: show, hide or toggle (default). | --target SURFACE|quick|active |
cursor | Prints 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.
| Flag | Use |
|---|---|
IDS | Up to 9 panes. Add :left or :right to an id to show only that pane of a split session. |
--mru | Fill the grid with the sessions that you used most recently. |
--font-size N | Set the font size of the cells in points. |
--auto-size | Make the cells smaller when the grid has more cells. |
--close | Close the open dashboard. |
ngtermctl dashboard 3f2a 9c1e:left 77b0
window #
| Subcommand | Does | Main flags |
|---|---|---|
new [NAME] | Creates and opens a window, and prints its id. | --minimized |
list | Lists the windows with their id, name and state. | |
select [ID] | Brings a window to the front, or opens a closed window. | |
go | Goes 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 NAME | Renames 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 HOST | Opens 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 #
| Subcommand | Does | Main flags |
|---|---|---|
visibility [MODE] (default) | Shows or hides the quick terminal: show, hide or toggle (default). | |
type TEXT | Types text into the quick terminal. | --stdin |
text | Prints the text of the quick terminal. | --all, --lines N |
sidebar #
| Subcommand | Does |
|---|---|
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). |
expand | Expands all workspaces. |
collapse | Collapses all workspaces except the active workspace. |
width POINTS | Sets 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.
| Subcommand | Does | Main flags |
|---|---|---|
send TEXT | Sends a message and prints its id. | --to SESSION:PANE (repeat), --all, --workspace W, --stdin, --as |
read | Prints 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 #
| Subcommand | Does | Main flags |
|---|---|---|
inc | Makes the font larger. | --target, --pane |
dec | Makes the font smaller. | --target, --pane |
reset | Sets the font back to its default size. | --target, --pane |
keymap #
| Subcommand | Does | Main flags |
|---|---|---|
reload | Reads keymap.conf again and prints the number of problems in it. | |
list | Prints each action with its keys, the custom commands, and the problems in keymap.conf. | |
run NAME | Runs a custom command, as the command palette does. | --target |
For the format of keymap.conf, see Keys and custom commands.
hooks #
| Subcommand | Does |
|---|---|
reload | Reads hooks.conf again and prints the number of problems in it. |
list | Prints each hook with its running process, its queue and its last failure. |
For the format of hooks.conf, see Event hooks.
browser #
| Subcommand | Does |
|---|---|
clear | Removes 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 #
| Subcommand | Does | Main flags |
|---|---|---|
set [NAME] | Sets and saves the terminal theme. Without a name, it sets the default theme of Ghostty. | --light NAME, --dark NAME|none |
list | Lists 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.
| Subcommand | Does | Main 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 ID | Prints the current result of a picker. | |
cancel ID | Cancels 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.
| Subcommand | Does | Main 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 ID | Prints the current result of a dialog. | |
cancel ID | Cancels 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.
| Subcommand | Does |
|---|---|
mode [MODE] | Prints the restore mode, or sets it for the next start: none (fresh shells), rerun or live. |
capture | Saves the running command of each pane now, so that a crash does not lose it. Only in rerun mode. |
clear | Clears the saved commands of all sessions, so that the next start opens plain shells. |
recent #
| Subcommand | Does |
|---|---|
list | Lists 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. |
clear | Empties 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.
| Subcommand | Does | Main flags |
|---|---|---|
list | Lists each live-session process and the pane that owns it. | |
screen NAME | Prints the screen of a live-session process, also for a closed window. | --all, --lines N |
prune | Stops the live-session processes that no pane owns and no terminal shows. | |
kill | Stops the live-session process of one pane and the program in it. | --target (necessary), --pane (necessary), --force (necessary) |
reset | Does 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 SESSION | Attaches 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.
| Subcommand | Does |
|---|---|
hook AGENT EVENT | Sends the data of an agent hook to the agent record of the pane. |
answered | Tells ngterm that a permission prompt got an answer in its dialog. |
interrupted | Tells ngterm that the chat view stopped a running turn. |
chat | Prints the conversation of the agent in a pane as NDJSON chat events, and follows it. |
commands | Prints the slash commands and skills of the agent in a pane as JSON. |
mail AGENT | Gives the messages in the mailbox of the pane to its agent. |
rerun AGENT HOOK | Runs a hook as the pane that has the conversation. |
upload | Saves 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:
| File | Contents |
|---|---|
SKILL.md | The model of ngterm, addressing, the NGTERM_* variables and a summary of all commands. |
reference.md | Each ngtermctl command with all flags, the JSON replies and the error messages. |
examples.md | Examples for frequent tasks. |
cookbook.md | How to find, read and install recipes from the cookbooks. |
troubleshooting.md | How 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:
- Select Help ▸ Install Agent Skill….
- Read the report. It lists each agent that received the skill.
- 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:
| Agent | Folder |
|---|---|
| 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:
| Area | Request |
|---|---|
| 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:
- Ask the agent: “What recipes are there?”
- Ask the agent to install the recipe that you select.
- Read what the agent shows: what the recipe does, what it must have, and the lines that it adds.
- Tell the agent to continue.
- 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:
- Most commands have a menu item and a row in the command palette.
- You can change each key in
keymap.conf(see Keys and custom commands). - The palettes and the title bar lists accept ↑, ↓, Enter and Esc. Dialogs accept Enter and Esc.
- The dashboard and the session switcher work from the keyboard.
Text size #
| Setting | What it changes |
|---|---|
| Settings ▸ Appearance ▸ Font size | The default font size of the terminals. |
| View ▸ Increase Font Size, Decrease Font Size | The font size of the focused pane. |
| Settings ▸ Appearance ▸ Sidebar font size | The text of the sidebar, from 9 to 20 points. |
| Settings ▸ Appearance ▸ Sidebar density | The space between the sidebar rows: Default or Compact. |
| Settings ▸ Appearance ▸ Palette and switcher font size | The 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:
| Platform | Setting |
|---|---|
| Linux | The animations setting of your desktop, through the settings portal (enable-animations). |
| Windows | Show animations in Windows. |
| macOS | Reduce 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:
| Platform | Log 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:
- Make sure that ngterm runs.
- In a session of ngterm, add
--socket "$NGTERM_SOCKET"to the command. - 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:
keymap.confhas a problem on that line.- The key is in use by another action. ngterm then keeps the custom command in the command palette only.
- The key is reserved: CtrlTab, or Ctrl1 and Ctrl2.
- A text field has the focus, for example a rename field, a palette or Settings.
- The command runs in
/bin/sh -c(cmd.exeon Windows), without your aliases, functions or fullPATH.
Fix:
- Run
ngtermctl keymap list. Read the problems and the key of each action. - Correct
keymap.conf. - In the command, use absolute paths, or run it through your login shell, for example
$SHELL -lc '…'. - 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:
- Run
ngtermctl session overlay result --jsonand readexitCode. - 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:
- You changed Settings ▸ General ▸ Restore sessions, but did not restart ngterm. The mode changes only at the next start.
- Your shell is not one that Live sessions take: bash, zsh, fish or PowerShell on Linux and macOS, or PowerShell, Git Bash, Command Prompt or WSL on Windows. Settings ▸ General then shows the reason under the restore mode.
- The pane is an overlay or the quick terminal. These are always temporary.
- The live-session process stopped, for example after a restart of the computer. ngterm then starts the command that the pane ran at the last clean quit. A crash, a forced quit or a power loss skips that capture.
Fix:
- Set Restore sessions to Live sessions, then restart ngterm.
- Run
ngtermctl live listto see each live-session process and its pane. - Run
ngtermctl tree --jsonand readbackedByLivefor 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:
- You did not load the config again after the change.
- The setting is in
~/.config/ghostty/config. ngterm reads that file only when Settings ▸ General ▸ Use my global Ghostty config is on. - A value that the Settings popup sets wins over the same key in
ghostty.conf. - Some keys apply only to new sessions, for example
window-padding-*,termandshell-integration-features. ssh-envandssh-terminfoinshell-integration-featureshave no effect in ngterm.
Fix:
- Put the setting in the
ghostty.confof ngterm (see Ghostty config and themes). - Run
ngtermctl config reload, and read the number of problems. - 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:
- Settings ▸ Notifications ▸ Show notification banners is off.
ngtermctl notifythen answersokand only updates the badge. - The operating system does not let ngterm show notifications, or a do-not-disturb mode is on.
Fix:
- Set Show notification banners to on.
- Let ngterm show notifications in the notification settings of your operating system.
- Run
ngtermctl tree --json. Ifunseenincreases 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:
- Select Help ▸ Install Agent Status Hooks….
- Open a new session, so that the shell loads the new configuration.
- Restart the agent. In Pi, you can also run
/reload. Restart OpenCode and Oh My Pi. - 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:
- To check an agent process, run
ps eww PID | tr ' ' '\n' | grep NGTERM_SESSION_ID. - 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
- Start tmux and session managers outside ngterm, or remove the
NGTERM_*variables withenv -uwhen 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"
Claude Code prints links as text #
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
Links do not work in tmux or vim #
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 #
- Find the version: run
ngtermctl version, or select Help ▸ About Ngterm. - Copy the related part of
ngterm.log. Remove tokens, passwords, host names and user names. - 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:
- Report a bug at https://github.com/nickalie/ngterm/issues.
- Send ideas and questions to https://github.com/nickalie/ngterm/discussions.
- Send a recipe for the cookbook (see The cookbook).
Credits #
ngterm is a Rust port of agterm by Umputun. It uses:
- The terminal engine of Ghostty.
- GPUI, the UI framework of Zed.
- The session server of herdr.
- The fonts Atkinson Hyperlegible and JetBrains Mono.
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.