A C-shell with integrated fuzzy finder, tab completion, all standard shell features and more without using curses.
Tab completion
shorter_tab.mov
Fuzzy-finder
shorter_fuzzy.mov
Autocompletion
shorter_autocomp.mov
Besides the basic &&
to chain multiple commands, |
to pipe one output to another, * and ?
for wildcard matching here are some more psh
syntax elements:
> or 1> stdout redirection
>> or 1>> output append
2> stderr redirection
2>> stderr append
< input redirection
&> merge stdout, stderr into single file
&>> append merge stdout, stderr to single file
<ctrl-f> to open
<ESC> to close
<Enter> to choose proposal
echo 'this argument counts as single arg' # currently only single quotes supported
echo you\ can\ also\ escape\ whitespace\ with\ backslash
You only need make and gcc to build. Also your terminal should be capable of displaying unicode characters.
$ git clone https://github.com/PhilippRados/PShell
$ cd PShell
$ make
$ echo /usr/local/bin/psh | sudo tee -a /etc/shells
If you want to install it somewhere else due to permission error in default-path make INSTALLDIR=<custom-path>
.
When successfully executed the commands above you can change psh
to your default shell like so:
$ chsh -s /usr/local/bin/psh
You can use this same command to change your shell back to your original one just swap out the path.
When first starting the shell you'll be prompted with an option to create a ~/.pshrc
file when you don't have one. This will set basic ENV-variables needed to run the shell.
# ~/.pshrc
PATH="some/interesting/path/$" # use $ to append to already extistant env-variable
TERM="linux" # without $ any existant env-variable gets overwritten
- Unit_tests: This requires the https://criterion.readthedocs.io/en/master/ testing lib for C.
When you have installed that you can run:
$ make run_tests # to run all tests $ make <file_name without .c> # to run specific tests
- Integration_tests:
$ docker build -t testing_container . # have to setup docker container for tests to run in $ make integration_tests # starts running integration tests in testing_container
If you find any bugs or some other kind of issue it would be great if you can open an issue. If you want you can of course also contribute with PRs which should just pass all tests to make sure they don't break anything.
- Implement local session ENV-variables using
export
andecho $SOME
- Have builtin command to search through past commands' output
- Allow for aliasing in ~/.pshrc
- Allow for inplace variable execution
- Improve fuzzy-finding algorithm
- support utf-8 instead of only ascii