vrsh

A small shell written in rust as a way for me to learn rust

Long term goal/dream (not gonna happen), achieve POSIX compliance (https://pubs.opengroup.org/onlinepubs/009604499/utilities/xcu_chap02.html).

Customizable prompt

To customize the prompt, one can set the PROMPT variable. This can be done using the set var=val syntax where val is a string, please note that if single quotes (') are used for the string the content of the string is preserved and prompt expansions will be performed on the prompt, see prompt expansions. If double quotes (") are used for the string, the standard expansions will be performed on the string (note that these are evaluated immediately whereas the single quote syntax is evaluated on each prompt display).

To make the prompt configuration permanent one can set the PROMPT variable in the ~/.vrshrc file (generated on application launch if it does not exist).

Prompt expansion

The following prompt expansions are currently supported:

Prompt expansion colors

To test colors in the current terminal, one can use the vrsh-colors command which will print all 256 supported foreground and background colors. The named colors and their numeric value are as follows: - red = 1 - green = 2 - orange = 3 - blue = 4 - purple = 5 - bluegreen = 6 - white = 7 - gray = 8 - darkred = 9 - brightgreen = 34 - brightblue = 123 - pink = 200 - yellow = 220

Examples

An example of the prompt that I myself currently use is the one below, it is somewhat verbose though.

set PROMPT='%F{blue} %~%f %F{orange} as %f %F{purple}%n%f %g %F{brightgreen} ❯ %f' PROMPT Gives the following prompt: prompt example

One can utilize the %~< and %~> options to print the full path but only highlight the current directory, for example:

set PROMPT='%F{31} %~<%f %F{51}%~>%f %F{214} as %f %F{170}%n%f %g %F{46} ❯ %f'

Gives the following prompt:

prompt example 2

Example output from the vrsh-colors command:

vrsh-colors example

Current & planned features

Currently only a small amount of features have been implemented but more are planned, feel free to suggest features to be added to the planned features list!

Current & planned features list: