Closing Panes & Zen Mode
This page explains four behaviors that are easy to miss: when Nash asks before it closes something, what Nash does to the programs in a pane that you close, how Zen Mode keeps its state, and when Nash tells you that it reloaded your configuration.
To get a pane out of the way without closing it, fold it instead. See Pane Folding.
Close a pane, tab, or window
| Command | Default keys | Asks first? |
|---|---|---|
| Close Pane | SUPER+W | Yes, if confirm_exit = true and the pane has work in it. |
| Close Tab | SUPER+SHIFT+W | Yes, if any pane in the tab has work in it. This includes hidden panes. |
When you close a window with the window button of your system, Nash asks if
confirm_exit = true and any pane in any tab of the window has work in it.
A pane has work in it when it runs any process that is not a plain shell.
Nash does not ask for a pane that only runs bash, sh, zsh, fish, tmux,
nu, nu.exe, cmd.exe, pwsh.exe, or powershell.exe. This list is the Lua
option skip_close_confirmation_for_processes_named.
Run the same close command again while the prompt is open, and Nash takes it as a "yes". Press SUPER+W twice to close a busy pane, or SUPER+SHIFT+W twice to close a busy tab. This needs Nash 0.2.0 or newer.
These two options in the [system] table of ~/.config/nash/nash.toml change
the behavior:
| Key | Shipped value | What it does |
|---|---|---|
confirm_exit | true | Asks before it closes a window that has work in it. Set it to false to close windows without a prompt. SUPER+W also stops asking. |
prevent_quit | true | Ignores the Quit command (Cmd+Q on macOS) and shows a notification instead. Set it to false to let Nash quit. |
What happens to the programs in a closed pane
When you close a pane, Nash ends every process that belongs to it. This cleanup runs on macOS and Linux. It needs Nash 0.3.0 or newer.
- Nash sends
SIGHUPto each process in the pane. - Nash waits up to 300 ms for them to exit. It checks often, so a process that exits at once does not delay the close.
- Nash sends
SIGKILLto every process that is still running, including processes that started during the wait.
The 300 ms grace period lets a shell save its history and lets a program clean
up. The final step makes sure that background jobs, and even nohup jobs, do
not stay behind when the pane is gone.
Keep tmux and other persistent sessions alive
Programs that keep sessions on purpose must not be ended with the pane. The Lua
option persistent_process_names lists them. The default list is tmux,
screen, zellij, dtach, and abduco. Nash matches the executable name,
exactly and with the same case.
| Process | What Nash does |
|---|---|
A listed client that runs inside the pane, such as tmux attach | Sends SIGHUP only. The client detaches. Nash never force-kills it. |
| A listed server that is outside the pane's session | Sends no signal. Your sessions stay alive. |
| Everything else | Follows the three steps above. |
To add a program, set the option in ~/.config/nash/custom.lua. Your list
replaces the default list, so include the defaults that you want to keep:
return { persistent_process_names = { 'tmux', 'screen', 'zellij', 'dtach', 'abduco', 'my-session-daemon', }, }
An empty list {} turns the exception off. Then Nash cleans up multiplexer
clients like any other process.
Zen Mode
Zen Mode dims the inactive panes so that the active pane stands out. Toggle
it with ALT+Z, or run Toggle Zen Mode from the command palette or the
View menu. The SetZenMode action turns it on or off explicitly.
While Zen Mode is on, inactive panes use the [zen] values below instead of the
normal [pane] values for inactive panes. Each value is a multiplier. A value
of 1.0 means no change, 0.5 means half, and 0.0 means none.
| Key | Shipped value | What it does |
|---|---|---|
mode | "global" | "global" uses one Zen flag for every tab. "tab" gives each tab its own flag. |
inactive_hue | 1.0 | Hue multiplier for inactive panes. |
inactive_saturation | 0.1 | Saturation multiplier for inactive panes. |
inactive_brightness | 0.1 | Brightness multiplier for inactive panes. |
Where Zen Mode keeps its state
Only mode is a saved preference. Whether Zen Mode is on is runtime state.
Toggling it never writes to nash.toml, and a configuration reload does not
change it.
Nash records the state in the session snapshot. In "tab" mode, each tab keeps
its own flag, and a restored tab gets its flag back. In "global" mode, Nash
loads the saved flag when it starts. See
Session Restore.
Runtime Zen Mode state needs Nash 0.2.0 or newer.
Configuration reload feedback
Nash reloads your configuration in two cases:
- You run Reload Configuration (SUPER+R, or CTRL+SHIFT+R).
- You save a file that Nash watches:
nash.toml,themes.toml,custom.lua, orkeys.luain the configuration directory.
After a successful reload of either kind, Nash shows a Configuration reloaded toast in the window. This needs Nash 0.2.0 or newer.
Nash shows no toast for reloads that it starts itself, such as a reload after the system appearance changes. Nash also shows no toast when a reload fails. A failed reload opens the configuration error window instead, so read the error there and correct the file.