Skip to main content

Module shells

Module shells 

Source
Expand description

The shells installed on this machine, and which one a new local terminal runs: the default-shell setting (docs/specs/SPEC_DEFAULT_SHELL_SETTING_2026_10_13.md).

  • list: every shell found, with a name and version, for Settings.
  • resolve_for_spawn: the shell a terminal starts with. The block’s own term:localshellpath, else the global setting, else the automatic choice (PowerShell 7, then Windows PowerShell, then Command Prompt on Windows; $SHELL, then /bin/bash elsewhere). A chosen shell that isn’t there falls back to the automatic one, so a stale setting never stops a terminal from opening.

Finding candidates is written over an injected environment and filesystem, with Windows paths handled as strings, like posix_shell::resolve_windows, so the order is tested on every host.

Structs§

SpawnShell
The shell a new local terminal starts with.

Functions§

automatic
The automatic choice, as before the setting was honoured: PowerShell 7 on PATH, else Windows PowerShell, else Command Prompt; elsewhere $SHELL, else /bin/bash.
for_block
The shell and extra arguments a block’s interactive terminal starts with: resolve_for_spawn on the block’s and the global term:localshellpath, and the block’s term:localshellopts, else the setting’s (appended after the shell-integration arguments). Logs a configured shell that wasn’t found.
list
What Settings shows: the shells found, the automatic choice, and what a new terminal starts with under global_setting. Blocking: run it off the async runtime.
resolve_for_spawn
Which shell a terminal starts with: the block’s term:localshellpath, then the global setting, then automatic.
with_user_opts
The shell’s arguments: the integration ones and the user’s term:localshellopts. PowerShell’s integration ends -File <script>, and anything after -File goes to the script, so the user’s options go before it; elsewhere they follow (bash wants its long options, --rcfile, first).