2.5 KiB
Sqish
Sqish's goal
Squi's Shell, aka Sqish. This is an attempt to create a simple but usable shell in Rust, because why not. The goal (for me) is also to get more familiar with Rust since I read the Rust book and want to try things out. And, at last, building and using your own tools is pretty cool.
I also implemented user-configurable hotkeys (they're more akin to a form of macros really), because I don't think a lot of shells do that and I wanted something unique.
Current state
Currently, the shell is pretty rough around the edges, but usable, at least for my day to day use. It's not really and equivalent to bash as it does not implement any form of scripting; the only supported operation is piping. My goal is to build a shell for my everyday use as a Linux sysadmin: simple, fast, with just the features that I need.
Scripting ?
I don't like shell scripting and don't use it (I know the basics, but Ansible and Python are my bread and butter). Building a lexer is not part of the project. Bash / Zsh / Python / etc are still usable when running sqish, so that's that.
Sqish is now my default shell on my home computer, and I'll keep adding features as I come across them.
Also keep in mind I'm a beginner in Rust, so the code is pretty dirty; I will probably come around to reformating it once I have all the features I want and ironed out all the bugs.
TODO:
- Allow redirecting >> to the end of a file ?
- Allow && in commands ?
- Improve word jumping
- Add arguments : run a file (sqish myexec) which I believe would make it compatible with gdb ?
- Add export command
sqishrc (Config)
See the included sqishrc file included for comments, and copy it as ~/.sqishrc for use (optionnal).
Built-in shortcuts
As Hotkeys
Some shortcuts are built in. They may be unique to Sqish or be copied from Zsh for example.
- Ctrl+Q or Ctrl+D : Quits the shell immediatly
- Ctrl+U : Clears currently written line
- Alt+. : Appends the last word from previous command
- Alt+! : Show a list of the user-configured hotkeys and aliases
- Ctrl+A : Jumps to the end of the line
- Ctrl+E : Jumps to the start of the line
- Ctrl+C : Clears the current line and starts a new one
- Ctrl+L : Clears the screen
- Ctrl+P : Jump to the next word (kinda)
- Ctrl+O : Jump to the previous word (kinda)
In Text:
- !12 : Returns command number 12 from history (Replace the number 12 with any number from history). You can add commands after it, like: "!12 | grep squirrel"
- !! : Appends the previous command to the current line. Same principle as !12.