Named Workspace Sessions

Nash has two ways to save a layout. They use different files and different keys.

FeatureAutomatic history (session restore)Named workspace sessions
Saved whenNash exits, a signal arrives, or you askYou press a key, or autosave runs
CoversEvery windowOne workspace (session)
Filesstate/saved-sessions/ (Nash 0.9.4)nash-sessions/state/nash_state_<workspace>.json
Restore withRestore Saved Session (the dialog)ALT+l
Opens the restore dialogYesNo

Read Session Restore for the automatic history. This page covers the named workspace sessions.

Keys

The bundled configuration binds these keys. A workspace here is the same thing that Nash calls a session in the multiplexer.

KeyAction
ALT+sSave the current workspace to its own file.
ALT+lChoose a workspace, then load all of it or pick one tab.
ALT+rOpen the restore dialog.
ALT+aTurn autosave on or off.
ALT+fFork the current workspace into a new workspace that you name.
CTRL+SHIFT+dDelete a saved workspace.
CTRL+SHIFT+eOpen a saved workspace file in your editor.

ALT+s does not add to the history that the restore dialog reads. It writes the named workspace file. To save into the automatic history, run Save Window Session from the command palette.

Where the files live

Each workspace has one file, nash_state_<workspace>.json, in the nash-sessions/state/ directory inside your Nash configuration directory. The files survive application updates.

CTRL+SHIFT+e opens the file with the program in $EDITOR, or with nvim when $EDITOR is not set.

Autosave

Autosave is off until you press ALT+a. When it is on, Nash saves the current workspace every 30 seconds and shows a short notification when you turn it on or off.

The on or off choice survives a configuration reload. It does not survive a restart of Nash, so press ALT+a again after you start Nash.

Git branch warning

When you save a workspace, Nash records the git branch of each pane's directory. When you load the workspace, Nash compares the branch with the current one. If a branch changed, the notification lists each repository with the saved and the current branch, for example api: main -> feature/login.

What a load restores

A load recreates the tabs, the splits, and the working directories of the workspace. For each pane whose foreground program is not a shell, Nash types that program into the new pane and presses Enter.

  • On Linux, Nash saves the full command line of the program.
  • On macOS, Nash saves only the program, without its arguments.
  • On Windows, Nash does not start programs again.

Nash treats sh, bash, zsh, fish, nu, cmd.exe, powershell.exe, pwsh.exe, and wsl.exe as shells and does not type anything for them.