Currently nsh is incomplete and not yet stable. Succeeded in crashing nsh? Let me know!
A command-line shell that focuses on performance and productivity featuing:
- A not-yet-completed-but-aims-to-be Bash compatible interactive shell.
- Tab completions and syntax highlighting like fish.
- A builtin interactive fuzzy completion filter like fzf.
- Builtin zero configration features.
- Written in Rust 🦀
$ cargo install nsh
To enable completions, install (bash-completion). If you are using macOS, install newer Bash as well:
$ brew install bash bash-completion@2
Set the following variables in ~/.nshrc
:
$PATH
$PROMPT
: The prompt format. See prompt.md for details.
Key | Action |
---|---|
Up | Select the previous history. |
Down | Select the next history. |
^C | Clear the input. |
^L | Clear the screen. |
^W | Delete the previous word. |
^K | Delete from cursor to the end of input. |
M-f (Alt+Right) | Move the cursor to the next word. |
M-b (Alt+Left) | Move the cursor to the previous word. |
^A | Move the cursor to the beginning of input. |
^E | Move the cursor to the beginning of input. |
TAB | Enter the completion mode. |
^R | Enter the history search mode. |
Bash is the best for executing shell scripts but its interactive mode is not satisfactory. I am a zsh user for the last decade but I don't need customizability and got tired of making my zshrc faster. Fish is really neat but I prefer old-fashioned, traditional, and ergonomic shell syntax.
nsh | bash | zsh | fish | PowerShell | |
---|---|---|---|---|---|
POSIX shell features | Yes | Yes | Yes | original syntax | No |
Bash compatibility | partially supported | 100% compatible | provides emulate(1) |
requires Bass | No |
Prompt UX | (aims to be) awesome | minimum standard | comfortable | awesome | comfortable |
Name | not bad | noble | cool | cute | super cool |
- macOS or Linux
- Rust 1.31.0 or higher
$ cargo build --release
$ ./target/release/nsh
$ cargo test
$ ./run-tests.py
The debug log file is located at ~/.nsh.log
. To enable debug log, run nsh with
RUST_LOG
evironment variable (i.e., $ RUST_LOG=nsh=trace nsh
).
nsh is in alpha stage: there are many missing features which Bash provides, there are kludges in source code, and there must be bugs. To make nsh practical for daily use, I need your help!
- Report bugs in GitHub issues. Please attach a minimal reproducible example (e.g. shell script) if possible. It helps me to fix the bug easier.
- Suggest enhancements in GitHub issues.
- Submit a Pull Request which implements a new feature, fixes a bug, refactors code, rephrases sentences in documentation, etc.
CC0 or MIT. Choose whichever you prefer.