Skip to content

isene/rush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rush

The fast shell. Written in Rust.

Rust License Platform Binary Startup Stay Amazing

A feature-complete terminal shell compiled to a single binary. Feature clone of rsh (Ruby Shell) rewritten in Rust for speed. Same workflow, same keybindings, 20x faster startup.

Features

Core Shell:

  • Command execution with pipes, redirects, background jobs, conditional operators
  • Nick aliases (:nick ls = ls --color -F) with parametrized templates ({{placeholder}})
  • Global aliases (gnicks) for text substitution anywhere in command
  • Abbreviations (fish-style): expand on space with visual feedback (:abbrev)
  • Directory bookmarks with tags (:bm work /projects #dev,daily)
  • Auto-cd into directories and bookmarks
  • Tilde, variable, brace, and command substitution expansion
  • Multi-line editing: continuation on \, |, &&, ||, unclosed quotes

Editing:

  • Full line editing with undo stack (Ctrl-_)
  • Syntax highlighting through pipes (each segment colored independently)
  • Right-arrow history suggestions (grayed inline preview)
  • Auto-closing quotes and brackets (", ', (, [, {)
  • Ctrl-G to edit command in $EDITOR
  • Ctrl-Y to copy line to clipboard
  • Ctrl-R reverse incremental history search (like bash)
  • Ctrl-A/E/K/U/W/L readline-compatible shortcuts

Tab Completion:

  • Interactive cycling with LS_COLORS file coloring
  • Selected item highlighted with reverse video
  • TAB/S-TAB cycle forward/backward, Enter accepts, ESC cancels
  • Command, file, directory, nick, bookmark, colon command completion
  • Environment variable completion ($PA<TAB> -> $PATH)
  • Smart subcommand completion (git, cargo, apt)
  • Switch completion from --help parsing (cached)
  • Completion learning (most-used ranked first)

History:

  • Deduplication modes: off, full, smart
  • Expansion: !! (last), !-N (Nth back), !N (by number)
  • Shift-TAB interactive history search with fuzzy filtering
  • Ctrl-R reverse incremental search (bash-style)
  • Timestamps stored with each history entry

Prompt:

  • Configurable colors for user, host, cwd, git branch, prompt character
  • Root user/host colors (red by default, visible warning when running as root)
  • Directory-specific colors (pattern matching on path)
  • Right-side prompt: git dirty/clean indicator, command duration (>1s)
  • Window title updates via OSC escape
  • Timestamp + expanded command display (configurable)

Job Control:

  • Background jobs with &
  • Ctrl-Z suspends foreground process
  • :jobs lists all jobs with status
  • :fg N resumes suspended job
  • Automatic cleanup of finished jobs
  • $PIPESTATUS tracking

Directory Navigation:

  • cd N jumps to Nth entry from :dirs history
  • pushd/popd directory stack
  • :dirs / :dirs -v for numbered listing
  • Auto-cd by typing directory name or bookmark

Configuration:

  • JSON config (~/.rushrc.json) and state (~/.rushstate.json)
  • 6 built-in themes: default, solarized, dracula, gruvbox, nord, monokai
  • :config key value to change settings live
  • :import_rsh to migrate nicks/bookmarks from existing .rshrc

Sessions & Recording:

  • :save_session / :load_session for full state save/restore
  • :record start / :replay for command sequence recording
  • Session autosave (configurable interval)

Safety:

  • Validation rules (:validate rm -rf = confirm)
  • Auto-correct with Levenshtein distance suggestions
  • Command-not-found package suggestions (via command-not-found)
  • Slow command threshold alerts
  • Nick recursion guard

Integrations:

  • AI: @ question (chat) and @@ task (command suggestion) via OpenAI
  • Calculator: :calc 2**10 + sqrt(144)
  • xrpn: = expr pipes to HP-41 RPN calculator
  • fzf: f for fuzzy file finding
  • File manager: r launches configurable file manager
  • Login shell support (--login / -l)

Installation

From source

git clone https://github.com/isene/rush
cd rush
PATH="/usr/bin:$PATH" cargo build --release
cp target/release/rush ~/bin/

Binary size

Build Size Startup
Release 2.5 MB ~26ms

Usage

rush                    # Interactive shell
rush -c "echo hello"    # Run command and exit
rush --login            # Login shell (sources profile files)

Keybindings

Key Action
Tab Complete (interactive cycling with LS_COLORS)
Shift-Tab History search (fuzzy filter)
Ctrl-R Reverse incremental history search
Ctrl-G Edit line in $EDITOR
Ctrl-Y Copy line to clipboard
Ctrl-_ Undo last edit
Ctrl-Z Suspend foreground process
Ctrl-C Clear line
Ctrl-D Exit (empty line)
Ctrl-L Clear screen
Ctrl-A / Ctrl-E Beginning / end of line
Ctrl-K / Ctrl-U Kill to end / beginning
Ctrl-W Delete word backward
Up / Down History navigation
Right Accept history suggestion

Commands

Command Action
:nick [name = val] Aliases
:gnick [name = val] Global aliases
:abbrev [name = val] Abbreviations (expand on space)
:bm [name [path] [#tags]] Bookmarks
pushd [dir] / popd Directory stack
:dirs [-v] Directory history
:history [n] Command history (with timestamps)
:theme [name] Color theme
:calc expr Calculator
= expr xrpn RPN calculator
:stats Command statistics
:jobs / :fg N Job control
:env [set/unset] Environment variables
:config [key val] Settings
:validate [pat = action] Safety rules
:save_session name Save state
:record start/stop Record commands
:replay name Replay recording
:import_rsh Import from ~/.rshrc
:rehash Rebuild command cache
:version / :info Version and features
:help Command reference

Configuration

All settings in ~/.rushrc.json. Use crush for an interactive TUI configuration editor with live color preview, theme selection, and 256-color palette:

{
  "nick": { "ls": "ls --color -F" },
  "abbrev": { "gst": "git status" },
  "c_user": 2, "c_host": 2, "c_cwd": 81,
  "c_user_root": 196, "c_host_root": 196,
  "c_prompt": 208, "c_cmd": 48,
  "dir_colors": [["MyProject", 172]],
  "show_cmd": true, "auto_correct": true,
  "rprompt": true, "auto_pair": true,
  "completion_fuzzy": true, "completion_limit": 10,
  "slow_command_threshold": 10,
  "file_manager": "rtfm"
}

Comparison with rsh

rsh (Ruby) rush (Rust)
Startup ~300ms ~26ms
Binary Ruby runtime 2.5MB standalone
Config Ruby eval (.rshrc) JSON (.rushrc.json)
Plugins Ruby files N/A
Features 76 89

Rush has more features than rsh: Ctrl-R search, abbreviations, auto-pair, undo, multi-line editing, right prompt, pushd/popd, $PIPESTATUS, and command-not-found suggestions.

Part of the Rust Terminal Suite

See the Fe₂O₃ suite overview and the landing page for the full list of projects.

Tool Clones Status
rush rsh Active
crust rcurses Planned
kastrup Heathrow Planned
tock Timely Planned
scroll brrowser Planned
pointer RTFM Planned

License

Unlicense - public domain.

Credits

Created by Geir Isene (https://isene.org) with extensive pair-programming with Claude Code.

About

Fast terminal shell written in Rust. Feature clone of rsh with 26ms startup, syntax highlighting, tab completion, nick aliases, and bookmarks.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages