TUI Full-Screen Mode
niuma_code's default interface is a full-screen terminal UI built on prompt_toolkit, optimized for long coding sessions. The input box stays fixed at the bottom โ you can append new messages at any time during LLM streaming output.
Layout
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Output Area (scrollable) โ
โ โ
โ [Conversation messages + Thinking content] โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ [1/3] "current message" โ โ Queue bar
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ > Type your message here... โ โ Input box
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [|] model ยท high ~1234 out / ~5678 in โ โ Status bar
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Layout layers (top to bottom):
- Output Area โ auto-scrolling conversation display with ANSI color rendering
- Queue Bar โ shows
[N/M] "current message"when messages are queued, orโโseparator - Input Box โ single-line input with autocomplete, expands up to 10 lines with word wrap
- Separator โ dynamic-width divider
- Status Bar โ real-time streaming status (spinner, tokens, model, effort)
9 Modal Overlays
Access overlays via keyboard shortcuts or commands:
| Shortcut | Overlay | Access Method | Purpose |
|---|---|---|---|
/model |
Model Settings | Command only | Switch provider/model/effort via visual popup |
Ctrl+Q |
Message Queue | Keyboard | View and reorder pending messages |
/context |
Context Switch | Command | Multi-context management |
/messages |
Messages | Command | View, edit, merge, star conversation rounds |
/ide |
IDE Drafts | Command | Browse and select Python orchestration drafts |
/tag |
Tag Management | Command | Manage custom #tags |
/lang |
Language | Command | Switch UI language |
| Auto | Permission Confirm | Auto-trigger | Approve or deny tool execution |
/ide new |
Editor | Command | Exit TUI โ external editor โ return |
Note:
Ctrl+Mdoes NOT open Model Settings. In prompt_toolkit,Ctrl+M== Enter (both send0x0d). The model popup is command-only via/model.
Model Settings (/model)
Three-column navigation: Provider โ Model โ Effort.
| Key | Action |
|---|---|
โ/โ |
Move focus between columns |
โ/โ |
Cycle values within current column |
Enter |
Apply selection |
Esc |
Cancel (restore snapshot) |
Message Queue (Ctrl+Q)
| Key | Action |
|---|---|
โ/โ |
Select message |
Shift+โ/โ |
Reorder messages |
Delete |
Remove selected message |
Esc |
Close panel |
Context Switch (/context)
| Key | Action |
|---|---|
โ/โ |
Navigate contexts |
Enter |
Switch to selected context |
Delete |
Evict (remove) selected context |
Esc |
Close panel |
Messages (/messages)
Full conversation management with multi-select editing.
| Key | Action |
|---|---|
โ/โ |
Navigate units |
Ctrl+โ/Down |
Expand selection |
Alt+โ/Down |
Move unit position |
Delete or d |
Delete selected |
m |
Merge selected (LLM summarizes) |
c |
Clear all recall injections |
Enter |
Star/unstar round |
Ctrl+S |
Save changes to disk |
Esc |
Undo changes / Close |
IDE Drafts (/ide)
| Key | Action |
|---|---|
โ/โ |
Navigate drafts |
Enter |
Open selected draft in editor |
Delete or d |
Delete draft |
Esc |
Close panel |
Permission Confirm (auto)
When a tool needs approval, a centered popup appears with 4 options:
| Key | Option |
|---|---|
1 or โ/โ + Enter |
Allow (this time) |
2 |
Always allow (session) |
3 |
Always allow (tool type) |
4 |
Deny |
Keyboard Shortcuts
Global
| Shortcut | Action |
|---|---|
Enter |
Submit message |
Tab |
Trigger/accept autocomplete |
Ctrl+Enter |
Insert newline (without submitting) |
Esc |
Cancel current generation |
Ctrl+C |
Copy selected text (or cancel if nothing selected) |
Ctrl+D |
Exit program |
Ctrl+R |
Toggle memory recall on/off |
Ctrl+P |
Copy last LLM reply to clipboard |
Ctrl+I |
Open IDE mode (/ide) |
Ctrl+G |
Open system editor for input |
Ctrl+S |
Save messages (when /messages panel is open) |
PageUp/PageDown |
Scroll output area by 10 lines |
History Navigation
| Key | Action |
|---|---|
โ |
Previous input (when no overlay open) |
Down |
Next input (when no overlay open) |
Input Prompt Indicator
The input box shows different prefixes based on state:
>โ Normal mode๐งโ Memory recall enabled
Autocomplete System
Type special prefixes to trigger context-aware completions:
| Prefix | Triggers | Example |
|---|---|---|
@ |
File selector (fuzzy search) | @app/main.py |
/ |
Command completion | /model, /loop |
# |
Custom tag text expansion | #plan_mode, #skip_mode, or user-defined tags |
Completions appear as you type. Press Tab or Enter to accept, keep typing to filter.
Mouse Support
| Action | Behavior |
|---|---|
| Scroll wheel | Browse conversation history |
Ctrl+Scroll |
Adjust font size (Windows) |
| Left-click drag | Select text in output area |
| Left-click release | Auto-copy selected text to clipboard |
| Right-click | Paste from clipboard (or copy selection) |
Mouse support is active in the output area for text selection and scrolling. The output area highlights selected text with a distinct background color.
Status Bar
The status bar renders real-time information during LLM generation:
[|] model ยท high ~1234 out / ~5678 in
7 Status States
| State | Display | When |
|---|---|---|
| Idle | Final stats or empty | Between generations |
| Thinking | [spinner] ๆ่ไธญ... | model ยท effort |
Waiting for first token |
| Generating | [spinner] ~N out / ~M in | model ยท effort |
Streaming content |
| ToolExecuting | [spinner] tool_name (phase) |
Running a tool call |
| Compressing | [spinner] [==== ] 40% ๅ็ผฉไธญ |
Context compression |
| WaitingForCompression | [spinner] ็ญๅพ
ๅ็ผฉๅฎๆ |
Async compression pending |
| Error | Error: message (auto-clears in 5s) |
API/network errors |
The spinner cycles through [|] [/] [-] [\] at 100ms intervals during active states.
Input Features
Commands
Type / at the input to see available commands:
/model Open model selection popup
/context Multi-context switch (new/rename/del)
/clear Clear conversation history
/compact Manually compact context
/recall Toggle memory recall [Ctrl+R]
/loop Engineered task completion (planโrunโverify)
/copy Copy reply to clipboard [Ctrl+P]
/ls List files (fuzzy search)
/cat Read file content
/edit Open system editor [Ctrl+G]
/refactor Refactor code
/ide Python orchestration mode [Ctrl+I]
/new Start new topic
/messages Conversation management
/star Star/unstar conversation round
/tag Custom #tag management
/brainstorming Brainstorming design skill
/planning Planning-with-files skill
/help Show help
/restart Restart service
/quit /exit Exit program [Ctrl+D]
Model Switching
Use the /model command to open a TUI overlay or CLI list for model selection:
/model โ Open model selection overlay (TUI) or list all providers (CLI)
Type # followed by a tag name to trigger text expansion (not model routing):
#plan_mode โ Expand plan_mode tag
#skip_mode โ Expand skip_mode tag
Output Rendering Pipeline
LLM Stream โ _raw_buffer โ Rich Console โ StringIO โ ANSI parse โ FormattedText โ Output Area
- ANSI escape codes are parsed into prompt_toolkit FormattedText tuples, preserving Rich colors
- Terminal resize triggers dynamic separator width updates and output re-wrapping
- Context switching replaces the entire output area content (per-context output isolation)
Accessibility
- Font scaling:
Ctrl+Mouse Wheelfor font size adjustment - Keyboard-only: Full functionality without mouse
- High contrast: Works in most terminal color schemes
- Wide terminal: Responsive layout up to 200+ columns
- CJK support: Proper width calculation for double-width characters