You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Confusing error message when running script that couldn't find the shebang exe #15970
If the shebang executable could not be found, nushell will throw an error with a confusing message and a reference to the unhelpful Rust code.
~/scripts >: ./setup-links.sh
Error: nu::shell::io::not_found
× Not found
╰─▶ × Could not spawn foreground child
╭────
1 │ crates/nu-command/src/system/run_external.rs:284:17
· ─────────────────────────┬─────────────────────────
· ╰── Not found
╰────
This is how bash reports the error which I think is clearer:
[~/scripts]$ ./setup-links.sh
bash: ./setup-links.sh: cannot execute: required file not found
How to reproduce
Create a script with a nonexistent shebang executable
Invoke the script inside nushell
Expected behavior
Clear and concise error message
Configuration
key
value
version
0.104.0
major
0
minor
104
patch
0
branch
commit_hash
build_os
linux-x86_64
build_target
x86_64-unknown-linux-gnu
rust_version
rustc 1.86.0 (05f9846f8 2025-03-31) (built from a source tarball)
This is how fish reports the error, however we can only do the same if we're safe to assume that the errno returned by Command::spawn is from libc::execvp.
I can work on this if it's safe to make the assumption, otherwise this might be a architectural change since we have to implement the Command::spawn ourselves using libc like fish does.
Activity
wonrax commentedon Jun 17, 2025
This is how fish reports the error, however we can only do the same if we're safe to assume that the errno returned by
Command::spawnis fromlibc::execvp.https://github.com/fish-shell/fish-shell/blob/06578bd03d2d/src/fork_exec/postfork.rs#L229-L518
I can work on this if it's safe to make the assumption, otherwise this might be a architectural change since we have to implement the
Command::spawnourselves using libc like fish does.GunnerGuyven commentedon Oct 29, 2025
This also happens when a dependency is missing in a binary executable that can be identified by
ldd. This same error message appears.fix(run-external): explain a missing shebang interpreter instead of s…