/memory TUI leaks focus event escape sequences when editor opens
Resolved 💬 5 comments Opened Mar 11, 2026 by alexrybakdd Closed Mar 14, 2026
Description
When using the /memory command, opening a file in an external editor (VSCode) causes focus event escape sequences to appear as literal text in the TUI. The sequences persist and the terminal becomes unusable for navigation until the editor is closed.
Steps to reproduce
- Open Claude Code in iTerm2
- Run
/memory - Select a memory file (e.g. User memory)
- VSCode opens the file
- Escape sequences appear as literal text in the terminal
Observed behavior
Escape sequences are printed as visible text in the /memory TUI:
^[[O^[[I^[[O^[
These appear to be focus in/out sequences (CSI I / CSI O) fired when the terminal window loses and regains focus as VSCode opens.
Expected behavior
Focus event sequences should be consumed internally by the TUI and not displayed as visible text.
Environment
- OS: macOS
- Terminal: iTerm2
- Editor: VSCode (
code --wait)
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗