Skip to main content

Overview

Qwen Code’s interactive mode provides a rich terminal UI for conversing with AI in real-time. When you run qwen without arguments, you enter an interactive session where you can chat naturally, issue commands, and see AI actions unfold live.

Starting Interactive Mode

# Launch interactive UI
qwen

# Start with a prompt and continue interactively
qwen --prompt "Explain this codebase" --continue

Key Features

Real-Time Streaming

The interactive UI streams responses as they’re generated, showing:
  • AI thinking and reasoning
  • Tool calls being executed
  • File edits with syntax highlighting
  • Command outputs with proper formatting

Visual Feedback

When AI executes tools, you see:
  • Tool name and arguments
  • Progress indicators for long-running operations
  • Success/failure status with colored indicators
  • Structured output formatting

Terminal Controls

Keyboard Shortcuts

ShortcutAction
Ctrl+CCancel current operation
Ctrl+DExit session
Shift+TabCycle through approval modes
EscCancel pending slash command
/ Navigate command history
TabAuto-complete commands and paths

Vim Mode

Enable Vim-style keybindings for input:
/vim
In Vim mode:
  • Esc enters normal mode
  • i, a, o enter insert mode
  • h, j, k, l for navigation
  • w, b, e for word movement

Session Management

Starting Fresh

# Clear conversation and start new session
/clear

# Alternative commands
/reset
/new
/clear resets the conversation history and frees up context, but preserves your configuration and settings.

Resuming Sessions

# Open session picker
/resume
The resume dialog shows:
  • List of recent sessions with timestamps
  • Session descriptions (first user message)
  • Fuzzy search to filter sessions
  • Arrow keys to select, Enter to load

Exiting Gracefully

# Quit with summary
/quit

# Alternative
/exit
On exit, you’ll see:
  • Total session duration
  • Number of turns
  • Token usage statistics

Advanced UI Features

Debug Mode

Enable detailed logging:
export DEBUG=qwen:*
qwen
Debug mode displays:
  • API request/response details
  • Tool execution traces
  • Performance metrics
  • Internal state changes

Stats and Monitoring

# View session statistics
/stats

# Model-specific stats
/stats model

# Tool usage breakdown
/stats tools

Theme Customization

# Open theme selector
/theme
Available themes:
  • Light
  • Dark
  • High Contrast
  • Solarized
  • Custom themes via settings

Rich Formatting

The interactive UI renders:
  • Headers and emphasis
  • Code blocks with syntax highlighting
  • Lists (ordered and unordered)
  • Tables
  • Blockquotes
  • Links (not clickable, but visible)

Context Indicators

The footer displays:
  • Current approval mode (plan/default/auto-edit/yolo)
  • Token usage (current/limit)
  • Active model name
  • Session ID
  • Working directory
Press Shift+Tab to cycle approval modes on-the-fly without opening the settings dialog.

Accessibility

Screen Reader Support

Enable screen reader mode:
// settings.json
{
  "accessibility": {
    "screenReader": true,
    "enableLoadingPhrases": true
  }
}
Screen reader mode:
  • Announces AI responses
  • Reads tool execution status
  • Provides audio feedback for state changes
  • Simplifies visual output for clarity

Keyboard Navigation

All features are keyboard-accessible:
  • Tab through interactive elements
  • Arrow keys for list navigation
  • Enter to confirm, Esc to cancel
  • No mouse required

Performance Considerations

Large Outputs

The UI handles large outputs efficiently:
  • Virtual scrolling for long conversations
  • Pagination for tool results
  • Compression of old context
  • Memory-efficient rendering

Memory Management

# Compress context to free memory
/compress

# Alternative
/summarize
Compression:
  • Replaces old messages with summaries
  • Preserves semantic meaning
  • Reduces token usage
  • Allows longer sessions

Troubleshooting

Try:
  • Compress context with /compress
  • Start a new session with /clear
  • Reduce model token limits in settings
  • Disable debug mode if enabled
  • Ensure terminal supports UTF-8
  • Resize terminal window
  • Try a different theme with /theme
  • Check for font issues
  • Verify terminal supports 256 colors
  • Try export TERM=xterm-256color
  • Use high contrast theme
  • Check terminal emulator settings
  • Check for terminal keybinding conflicts
  • Disable Vim mode if enabled
  • Try alternative shortcuts
  • Verify terminal emulator compatibility

Best Practices

  1. Use /clear periodically to free up context and maintain performance
  2. Enable Vim mode if you prefer modal editing
  3. Customize your theme for optimal readability
  4. Use /stats to monitor token usage and stay within limits
  5. Leverage /compress before hitting context limits
  6. Resume sessions to continue previous work
  7. Use shortcuts to speed up common operations

Next Steps

Session Commands

Learn all available slash commands

Approval Modes

Control how AI tools are approved

Headless Mode

Run non-interactively for automation

Subagents

Delegate tasks to specialized agents