Skip to content

v1.1.0 - Enhanced Multi-Line Editor

Choose a tag to compare

@jwesleye jwesleye released this 01 Nov 16:48

🎉 What's New

Enhanced Multi-Line Editor with Keyboard Controls

The multi-line editor now features intuitive keyboard controls that make entering code blocks and long prompts feel natural:

New Features:

  • ⌨️ ESC Key Cancellation - Press ESC to instantly cancel multi-line input
  • ⬆️ Up Arrow Editing - Press ↑ at the start of a line to go back and edit the previous line
  • 📋 Full History Integration - Entire multi-line blocks saved to history, recall with ↑ at main prompt
  • 🎯 Line Numbers - Clear context with numbered lines (1│, 2│, etc.)
  • 🖥️ Cross-Platform - Works on Unix, Linux, Mac, and Windows
  • 📝 Status Feedback - Clear visual indicators for all actions

How It Works:
```bash
You: \\
Multi-line mode:
• Empty line to submit
• ESC or .cancel to cancel
• ↑ or .back to edit previous line
1│ First line here
2│ Second line with typo
3│ [press ↑]
↑ Editing line 2...
2│ [press ↑ again to recall line]
2│ Second line fixed
3│ Third line
4│
✓ 3 lines captured
```

Technical Implementation:

  • Zero external dependencies - uses Python stdlib only
  • Platform-specific terminal control (termios/tty for Unix, msvcrt for Windows)
  • Graceful fallback to `.cancel` and `.back` commands
  • 100ms timing window to distinguish ESC from arrow sequences
  • Maintains full readline editing capabilities

Testing

  • ✅ 286 tests passing (13 new tests for multi-line editor)
  • ✅ Comprehensive coverage of all keyboard controls
  • ✅ Edge cases: empty lines, no previous line, multiple edits
  • ✅ Cross-platform compatibility verified

Bug Fixes & Improvements

  • Fixed ruff F401 unused import warnings
  • Added proper type annotations
  • Updated documentation

📦 Installation

```bash
pip install --upgrade basic-agent-chat-loop
```

📚 Documentation

See MULTILINE_EDITOR_ENHANCEMENTS.md for complete documentation and usage examples.


Full Changelog: v1.0.1...v1.1.0