Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Interactive Features

Hash shell includes powerful interactive features for efficient command-line use.

Features Overview

FeatureDescription
Line EditingCursor navigation, editing shortcuts
Tab CompletionComplete commands, files, directories
Command HistoryNavigate and search previous commands
Prompt CustomizationGit integration, colors, custom format

Quick Reference

Line Editing

KeyAction
Ctrl+AMove to beginning of line
Ctrl+EMove to end of line
Ctrl+UDelete to beginning
Ctrl+KDelete to end
Ctrl+WDelete word backward
Ctrl+LClear screen
Ctrl+CCancel current line

History Navigation

KeyAction
UpPrevious command
DownNext command
!!Repeat last command
!nRun command number n
!prefixRun last command starting with prefix

Tab Completion

ContextCompletes
First wordCommands, aliases, builtins
Other wordsFiles, directories
Double TABShow 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