you@arch ~ $ swagsh
swagsh
// a shell, the way i want it
a fast, minimal, modern linux shell built in rust. real shell grammar, full expansions, job control, readline-style editing and a customisable prompt. the name is swag, for stylish flair.
~ ❯ for i in 1 2 3; do echo "line $i"; done
line 1
line 2
line 3
~ ❯ name=takashi; echo "hi, ${name}"
hi, takashi
~ ❯ cat log | grep err | wc -l
7
~ ❯
features
## a real shell. no surprises.
shell grammar
pipelines, redirections, control flow, functions, subshells and here-documents.
expansions
variable, parameter, tilde, glob, arithmetic and command substitution.
line editing
readline-style editing out of the box: arrow-key recall, emacs-style keybindings, Ctrl-R history search.
job control
background jobs, foreground and background switching, stopping and signalling.
prompt
a customisable $PS1 with escape sequences for the working directory, user, host and more.
history
persistent history that respects $HISTFILE and $HISTSIZE, with a private mode.
performance
## fast where it counts
measured with hyperfine --shell=none on linux x86-64, across loops, expansions, pattern matching and process spawning.
up to 6.6x faster than bash
on recursive function calls and tight loops, swagsh leaves bash far behind.
2-3.6x across the board
parameter expansion, pattern matching, function calls, conditionals: all comfortably ahead of bash.
keeps pace with dash
dash is hand-tuned c with no interpreter overhead to shave, and swagsh still matches or beats it on loops, pattern matching and recursion.
installation
## pick your platform
cargo (all platforms)
cargo install swagsh# requires rust (edition 2024)
aur (arch linux)
paru -S swagsh# or yay
from source
git clone https://github.com/takashialpha/swagshcd swagsh && cargo build --release# binary at target/release/swagsh
run swagsh --help for the full option set.