Summary
Ratty crashes on first launch with Error: failed to spawn shell — Unable to spawn /bin/bash (ENOENT) on systems that don't ship /bin/bash (NixOS, some BSDs, minimal
containers). The default config hardcodes [shell] program = "/bin/bash", which is checked before the existing $SHELL fallback in src/runtime.rs, so the fallback never runs.
Steps to reproduce
- Install ratty on a system with no
/bin/bash (e.g. NixOS).
- Run
ratty with no user config (uses the bundled config/ratty.toml).
- Crash.
Expected behavior
Ratty should launch the user's $SHELL, falling back to /bin/sh (POSIX-mandated and universally present) only if $SHELL is unset.
Environment
- OS: NixOS (kernel 6.18.26)
- Ratty version / commit: 0.2.0 (
8b14267)
- GPU / graphics stack: (irrelevant — fails before any rendering)
- Config changes: none — reproduces with default
config/ratty.toml
Additional context
When I was goofing with nix builds, I got some reference error from nix run:
Error: failed to spawn shell
Caused by:
Unable to spawn /bin/bash because it doesn't exist on the filesystem or is not executable (ENOENT: No such file or directory)
Source of the issue: config/ratty.toml sets program = "/bin/bash", and src/runtime.rs:215-221 checks config.shell.program before env::var("SHELL"), so the explicit
config value always wins.
Fix is two lines (PR ready on fix/shell-default):
- Remove
program = "/bin/bash" from config/ratty.toml.
- Change
/bin/bash → /bin/sh for the final fallback in runtime.rs:221.
Summary
Ratty crashes on first launch with
Error: failed to spawn shell — Unable to spawn /bin/bash (ENOENT)on systems that don't ship/bin/bash(NixOS, some BSDs, minimalcontainers). The default config hardcodes
[shell] program = "/bin/bash", which is checked before the existing$SHELLfallback insrc/runtime.rs, so the fallback never runs.Steps to reproduce
/bin/bash(e.g. NixOS).rattywith no user config (uses the bundledconfig/ratty.toml).Expected behavior
Ratty should launch the user's
$SHELL, falling back to/bin/sh(POSIX-mandated and universally present) only if$SHELLis unset.Environment
8b14267)config/ratty.tomlAdditional context
When I was goofing with nix builds, I got some reference error from
nix run:Caused by:
Unable to spawn /bin/bash because it doesn't exist on the filesystem or is not executable (ENOENT: No such file or directory)
Source of the issue:
config/ratty.tomlsetsprogram = "/bin/bash", andsrc/runtime.rs:215-221checksconfig.shell.programbeforeenv::var("SHELL"), so the explicitconfig value always wins.
Fix is two lines (PR ready on
fix/shell-default):program = "/bin/bash"fromconfig/ratty.toml./bin/bash→/bin/shfor the final fallback inruntime.rs:221.