Interactive Features
Hash shell includes powerful interactive features for efficient command-line use.
Features Overview
| Feature | Description |
|---|---|
| Line Editing | Cursor navigation, editing shortcuts |
| Tab Completion | Complete commands, files, directories |
| Command History | Navigate and search previous commands |
| Prompt Customization | Git integration, colors, custom format |
Quick Reference
Line Editing
| Key | Action |
|---|---|
Ctrl+A | Move to beginning of line |
Ctrl+E | Move to end of line |
Ctrl+U | Delete to beginning |
Ctrl+K | Delete to end |
Ctrl+W | Delete word backward |
Ctrl+L | Clear screen |
Ctrl+C | Cancel current line |
History Navigation
| Key | Action |
|---|---|
Up | Previous command |
Down | Next command |
!! | Repeat last command |
!n | Run command number n |
!prefix | Run last command starting with prefix |
Tab Completion
| Context | Completes |
|---|---|
| First word | Commands, aliases, builtins |
| Other words | Files, directories |
| Double TAB | Show all matches |
Unknown Commands
When a command is not found, an interactive shell says so and, when a builtin,
alias, function or executable on PATH is within one or two edits of what was
typed, suggests it:
#> ehco hi
hash: ehco: command not found
Did you mean: echo?
#> sl
hash: sl: command not found
Did you mean one of these? ls nl pl
Only the closest names are offered, the status stays 127, and scripts and
hash -c get the plain message.
Default Prompt
The default prompt shows:
/home/user/projects git:(main) #>
- Blue path
- Green/Yellow git status (clean/dirty)
- Cyan branch name
- Blue/Red
#>based on exit code
Configuration
Configure interactive features in ~/.hashrc:
# Custom prompt
set PS1='\W\g \e#>\e '
# Enable colors
set colors=on