Skip to content

matan-h/rust-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-shell

a unix shell written in rust

screenshot of rust-shell

Features

Main features

  • has .rc file (in ~/.rstshrc)
  • has syntax highlighting
  • fish-like autosuggestion
  • emacs editing mode ,like what bash has (using rustyline)

Supported built-ins

  • has source builtin, so you can run a file for set of commands.
  • support export and alias - even with spaces (alias ls = ls --color=auto or export PATH =$PATH:$HOME/.cargo/bin/), see more examples in the examples folder

Supported syntaxes

  • support pipelines (with space on both sides) (like cat file | grep finder)
  • support bash comments

Prompt

  • support PS1 variable - with escapes and even with some commands : for example, you can use the starship prompt with export PS1="$(starship prompt --status=$exit_status)" - to make that the default, write it to ~/.rstshrc
  • every time command exit with no-success, the > at the end of the prompt will be red in the default prompt, instead of green (the color present in the $PS1 as $red_or_green, and the last exit status present as $exit_status)
  • live pwd in prompt (like, when using cd folder, the prompt will be updated to ~/folder).

install

download the executable from github-releases (created by the github action automatically ), then run it through the command line, (for linux, you need to chmod +x it first)

Contribute:

  1. install rustup and cargo
  2. Clone this repo (git clone https://github.com/matan-h/rust-shell.git)
  3. run it with cargo run