Time has come. Make way for the famous 42sh!
sudo apt install libncurses5-dev
KEY | FUNCTION |
---|---|
right | Move cursor right. |
left | Move cursor left. |
ctrl+right | Move cursor to the beginning of a word. |
ctrl+left | Move cursor to the ending of a word. |
ctrl+up | Move cursor to the upper line. |
ctrl+down | Move cursor to the lower line. |
up | Navigate to older command in history. |
down | Navigate to newer command in history. |
ctrl+r | Reverse-i-search. |
home | Move cursor to the beginning of current command. |
end | Move cursor to the ending of current command. |
ctrl+l | Clear input buffer. |
ctrl+u | Cut left side of the command from cursor. |
ctrl+k | Cut right side of the command from cursor. |
ctrl+p | Paste internal clipboard content. |
- Minishell prerequisites
- Prompt display
- Run commands with their parameters and PATH monitoring
- Error monitoring without using erno, and return values of commands
- Correct spaces and tabulations monitoring
- 21sh prerequisites
- Full edition of command line
- Redirection and aggregation operators
- Pipe
- Separator
- Built-ins
- cd
- echo
- exit
- type
- Logical operators
- "&&"
- "||"
- Monitoring of internal shell variables
- Internal variable creation depending on syntax: name=value
- Internal variable exportation to the enviroment via built-in export
- Possibility to list shell internal variables via built-in set
- Internal and enviroment variables revocation via built-in unset
- Enviroment variable creation for unique command
- Simple expansion of parameters depending on syntax ${} (syntax is $EXPANSION)
- Exit code access of previous command via expansion
${?} (syntax is $ ?) - Job control monitoring with built-ins jobs, fg, bg and the & operator
- Correct monitoring of all signals
- Each built-in must have the enounced options by POSIX standard execept for explicit case ad set or unset
- Inhibitors ” (double quote), ’ (simple quote) and \.
- Complete management of the history.
- Alias management via built-ins alias and unalias.
- A hash table and built-in hash to interact with it.
- Contextual dynamic completion.
- Built-in test with the required operators.
- New opening quote in open quote.
- Trailing pipe not implemented.
- Fc carbage. Rewrite the whole built-in.
- Line edition with command including newlines.
- History exclamation expanded even if inside single quotes.
- Lexer does not recognize specified fd ie. 2> and 2>&1.
- Redirection with specified fd ie. 2> does not work.
- Redireciton with multiple specified fd ie. 2>&1 does not work.
- Specific process should have own return value recorded after completion.
- Cursor movement does not work with ctrl+key combination after commit 098687956be52f87e71d9ad68a4ce5d76ebe96ce, which fixed line edition with command including newlines.
- Absolute path for the file where history commands are saved in.
- Cd builtin does not align with the POSIX standard.
- Type builtin cannot handle alias specification because aliases are expanded in lexer. (comment: use single quotes to avoid this.)
- Shady stuff going on with the alias and unalias control including hashmap functions. Segfaults.
- Two or more consecutive expandable aliases cause segmentation fault.
- Export builtin can only modify existing enviroment variables. It cannot create new ones.
- $ expansion segmentation fault if there is no value.
- $ expansion wont work if the expandable value is joined with slash ie. $HOME/Documents.
- Invalid pointer being freed sometimes when alias expansion is done.
- Shell "freezes" if job is stopped.
- Aliases are expanded in lexer. This means that if the user wishes to find out specific alias using alias builtin, the argument has to be inside single quotes. Same syntax should be carried out when adding aliases to avoid undefined behavior.