Completion & Editing
The Jitzu shell includes a custom readline implementation with tab completion, history predictions, reverse search, text selection, and full line-editing support.
Tab Completion
Press Tab to trigger context-aware completions. The shell completes:
- File paths — files and directories in the current directory, with tilde (
~) and label expansion - Built-in commands — all 60+ shell builtins
- Executables on PATH — programs available in your system PATH
- Jitzu identifiers — variables, functions, and types from the current session
- Label paths — type a label prefix (e.g.
git:) and Tab completes paths within the labeled directory
Completion Workflow
If there’s a single match, it’s applied immediately. If there are multiple matches, a dropdown appears:
- Up/Down — navigate the dropdown
- Tab — accept the highlighted completion
- Escape — dismiss
> gre⇥ → grep
> src/Pa⇥ → src/Parser.cs
> git:proj⇥ → git:projects/History Predictions
As you type, the shell shows matching entries from your command history in a dropdown. Ghost text does not appear until you select an entry.
- Down Arrow — enter the history dropdown (ghost text appears for the selected entry)
- Tab — accept the selected prediction (or open completions if no entry is selected)
- Right Arrow — accept the ghost text
- Delete — remove the selected entry from history
- Escape — dismiss predictions
Reverse History Search
Press Ctrl+R to enter reverse search mode. Type a substring to search backward through history. Press Ctrl+R again to cycle to the next match.
(reverse-search): build
→ dotnet build --configuration ReleasePress Enter to execute the match, Escape to cancel, or any other key to exit search mode and edit the matched line.
History Navigation
When no dropdown is visible, the Up and Down arrow keys navigate through your full command history. History is persisted to disk across sessions.
- Up Arrow — previous command in history
- Down Arrow — next command in history
history— display full command history with line numbers
Duplicate commands are deduplicated — only the most recent occurrence is kept.
Line Editing
Cursor Movement
| Shortcut | Action |
|---|---|
Left / Right | Move cursor one character |
Ctrl+Left / Ctrl+Right | Jump by word |
Home / Ctrl+A | Move to beginning of line |
End | Move to end of line |
Editing
| Shortcut | Action |
|---|---|
Backspace | Delete character before cursor |
Ctrl+Backspace | Delete word before cursor |
Delete | Delete character after cursor |
Text Selection
| Shortcut | Action |
|---|---|
Shift+Left / Shift+Right | Extend selection by character |
Shift+Home / Shift+End | Select to beginning/end of line |
Ctrl+C (with selection) | Copy selection to clipboard |
Typing or pasting while text is selected replaces the selected region.
Other Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+C (no selection) | Cancel current line |
Ctrl+R | Reverse history search |
Escape | Dismiss predictions/completions |
Syntax Highlighting
The shell prompt applies live syntax coloring as you type, highlighting commands, keywords, strings, flags, pipe operators, and boolean values. Colors are configurable via the theme system.