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#

CommandDefault keysAsks first?
Close PaneSUPER+WYes, if confirm_exit = true and the pane has work in it.
Close TabSUPER+SHIFT+WYes, 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:

KeyShipped valueWhat it does
confirm_exittrueAsks 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_quittrueIgnores the Quit command (Cmd+Q on macOS) and shows a notification instead. Set it to false to let Nash quit.

Mux tabs: close is not detach#

Closing a mux pane or tab closes the server-owned content for every attached client. Closing its GUI window normally detaches the mux domain instead; the server keeps the panes running. Local panes in a mixed window still follow the normal close rules. Reconnect to return to detached panes; detaching does not create a tab for Reopen Closed Tab.

Since Nash 0.11.9, pane/tab close confirmation asks the server whether the pane is safe to close. The server uses its own skip_close_confirmation_for_processes_named and Lua mux-is-process-stateful hook; a GUI-only hook does not override that policy. Failure or a timeout keeps the confirmation prompt. This is separate from confirm_exit and from the window-detach behavior.

What happens to the programs in a closed pane#

When you close a GUI-owned pane, Nash ends every process that belongs to it. This cleanup runs on macOS and Linux. It needs Nash 0.3.0 or newer.

  1. Nash sends SIGHUP to each process in the pane.
  2. 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.
  3. Nash sends SIGKILL to 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.

ProcessWhat Nash does
A listed client that runs inside the pane, such as tmux attachSends SIGHUP only. The client detaches. Nash never force-kills it.
A listed server that is outside the pane's sessionSends no signal. Your sessions stay alive.
Everything elseFollows 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.

The 0.11.9 bundled configuration sets the scope in [zen] and dimming in [zen.inactive]. While Zen Mode is on, these dimming values replace the normal [pane.inactive] values. Each is a multiplier: 1.0 means no change, 0.5 means half, and 0.0 means zero.

TableKeyShipped valueWhat it does
[zen]mode"tab""global" uses one Zen flag for every tab; "tab" gives each tab its own flag.
[zen.inactive]hue1.0Hue multiplier for inactive panes.
[zen.inactive]saturation0.6Saturation multiplier for inactive panes.
[zen.inactive]brightness0.6Brightness 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.

Since Nash 0.11.9, a mux tab's flag in mode = "tab" is server-owned: other attached clients see it, and it survives detach/reattach while the server runs. Each GUI still chooses its own Zen scope and dimming preferences. Global Zen Mode remains GUI-local, not a server-wide toggle.

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, or keys.lua in 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.