Skip to content

Ratty fails to spawn shell on systems without /bin/bash #27

Description

@TheCodedKid

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

  1. Install ratty on a system with no /bin/bash (e.g. NixOS).
  2. Run ratty with no user config (uses the bundled config/ratty.toml).
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions