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
Shell
> 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

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.

Shell
(reverse-search): build
→ dotnet build --configuration Release

Press 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

ShortcutAction
Left / RightMove cursor one character
Ctrl+Left / Ctrl+RightJump by word
Home / Ctrl+AMove to beginning of line
EndMove to end of line

Editing

ShortcutAction
BackspaceDelete character before cursor
Ctrl+BackspaceDelete word before cursor
DeleteDelete character after cursor

Text Selection

ShortcutAction
Shift+Left / Shift+RightExtend selection by character
Shift+Home / Shift+EndSelect 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

ShortcutAction
Ctrl+C (no selection)Cancel current line
Ctrl+RReverse history search
EscapeDismiss 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.