/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

  1. Open Claude Code in iTerm2
  2. Run /memory
  3. Select a memory file (e.g. User memory)
  4. VSCode opens the file
  5. 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)

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗