Command Input
The command input widget provides the text entry field for sending commands to the game.
Overview
The command input:
- Accepts keyboard input for game commands
- Maintains command history
- Supports editing operations (cut, copy, paste)
- Can display a custom prompt
Configuration
[[windows]]
name = "input"
type = "command_input"
# Position and size
row = 38
col = 0
width = 120
height = 2
# Input-specific options
prompt = "> " # Input prompt
history = true # Enable command history
history_size = 1000 # Commands to remember
# Visual options
show_border = true
border_style = "rounded"
background_color = "#0A0A0A"
text_color = "#FFFFFF"
cursor_color = "#FFFFFF"
Properties
prompt
The prompt displayed before input:
prompt = "> " # Default
prompt = ">> " # Double arrow
prompt = "[cmd] " # Custom label
prompt = "" # No prompt
history
Enable command history:
history = true # Enable (default)
history = false # Disable
history_size
Number of commands to remember:
history_size = 1000 # Default
history_size = 100 # Smaller history
history_size = 5000 # Large history
Input Operations
Basic Input
| Key | Action |
|---|---|
Enter | Send command |
Escape | Clear input |
| Any text | Insert at cursor |
Cursor Movement
| Key | Action |
|---|---|
Left | Move cursor left |
Right | Move cursor right |
Home | Move to start |
End | Move to end |
Ctrl+Left | Previous word |
Ctrl+Right | Next word |
Editing
| Key | Action |
|---|---|
Backspace | Delete before cursor |
Delete | Delete at cursor |
Ctrl+Backspace | Delete word before |
Ctrl+Delete | Delete word after |
Ctrl+U | Clear line |
Ctrl+K | Delete to end |
Clipboard
| Key | Action |
|---|---|
Ctrl+C | Copy selection |
Ctrl+X | Cut selection |
Ctrl+V | Paste |
Ctrl+A | Select all |
History
| Key | Action |
|---|---|
Up | Previous command |
Down | Next command |
Ctrl+R | Search history (if supported) |
Display
Single Line
> look
Standard single-line input.
Multi-Line
[[windows]]
name = "input"
type = "command_input"
height = 3 # Multiple lines visible
Shows more context:
┌─ Input ────────────────────────────┐
│ > look │
│ │
└────────────────────────────────────┘
No Border
[[windows]]
name = "input"
type = "command_input"
show_border = false
show_title = false
height = 1
Minimal footprint:
> look█
Examples
Standard Input
[[windows]]
name = "input"
type = "command_input"
row = 38
col = 0
width = 120
height = 2
prompt = "> "
history = true
show_border = true
border_style = "rounded"
title = "Command"
Full-Width Minimal
[[windows]]
name = "input"
type = "command_input"
row = 39
col = 0
width = "100%"
height = 1
show_border = false
background_color = "#0A0A0A"
Centered Input
[[windows]]
name = "input"
type = "command_input"
row = 38
col = 20
width = 80
height = 2
prompt = ">> "
border_style = "double"
Command Processing
Command Flow
- User types command
- User presses Enter
- Command added to history
- Command sent to game server
- Input cleared for next command
Special Commands
Two-Face intercepts some commands:
| Command | Action |
|---|---|
;command | Client command (not sent to game) |
/quit | Exit Two-Face |
/reload | Reload configuration |
History Features
Navigation
Upcycles through older commandsDowncycles through newer commands- Current input is preserved when browsing
Persistence
Command history is saved between sessions in:
~/.two-face/history
Duplicate Handling
Consecutive duplicate commands are not added to history.
Focus Behavior
The command input:
- Automatically receives focus on startup
- Maintains focus during normal gameplay
- Returns focus when popups close
- Can be focused with
Ctrl+Ior clicking
Troubleshooting
Commands not sending
- Check input has focus (cursor visible)
- Verify connection is active
- Check for keybind conflicts with Enter
History not working
- Verify
history = true - Check
history_size> 0 - Check file permissions on history file
Cursor not visible
- Check
cursor_coloris visible - Verify widget has focus
- Check width is sufficient
See Also
- Keybinds Configuration - Input shortcuts
- Quick Tour - Basic usage
- Automation - Command automation