Skip to content

Fix: Restore clear command detection in terminals#919

Merged
gregpriday merged 1 commit intomainfrom
bugfix/issue-907-fix-clear-commands
Dec 10, 2025
Merged

Fix: Restore clear command detection in terminals#919
gregpriday merged 1 commit intomainfrom
bugfix/issue-907-fix-clear-commands

Conversation

@gregpriday
Copy link
Copy Markdown
Collaborator

Summary

Reconnects the InputTracker service to restore terminal clear command functionality. Clear commands (/clear, clear, cls) were previously being detected but not acting due to disconnected wiring during architecture migration.

Closes #907

Changes Made

  • Enhanced InputTracker to return array of InputResult for handling multi-command chunks (e.g., pasted commands)
  • Added useEffect to reset tracker state on terminal restart via restartKey dependency
  • Improved escape sequence handling to properly skip arrow keys and navigation sequences
  • Fixed bracketed paste mode to ignore newlines inside pasted content
  • Wired InputTracker into TerminalPane with proper terminal.clear() invocation
  • Added comprehensive test suite covering edge cases: backspace, escape sequences, paste, control characters

Technical Details

The fix addresses several edge cases identified during code review:

  • Multiple commands in single data chunk now properly detected
  • Escape sequences (arrow keys) no longer leave garbage in command buffer
  • Bracketed paste mode correctly preserves multi-line content
  • Terminal restarts properly reset tracker state to prevent stale buffer issues

- Enhanced InputTracker to return array of InputResult for multi-command chunks
- Added useEffect to reset tracker state on terminal restart (restartKey change)
- Improved escape sequence handling to properly skip arrow keys and navigation
- Fixed bracketed paste to ignore newlines inside pasted content
- Added comprehensive test suite covering all edge cases and input scenarios
@gregpriday gregpriday merged commit ebfe20d into main Dec 10, 2025
0 of 4 checks passed
@gregpriday gregpriday deleted the bugfix/issue-907-fix-clear-commands branch December 10, 2025 15:42
@gregpriday
Copy link
Copy Markdown
Collaborator Author

gregpriday commented Apr 7, 2026

Fixes regression from #352. InputTracker was disconnected during the Pty Host migration.

Regression audit for training data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clear commands no longer trigger terminal screen clear

1 participant