Have you tried tmux?
I use tmux, I have this exact same bug in tmux. It's part of why I use OpenCode and not Claude Code.
unfortunately it's buggy in tmux as well. last night I couldn't hit esc after a long, long session as it simply ignored the key. doesn't happen outside of tmux.
I use tmux, I have this exact same bug in tmux. It's part of why I use OpenCode and not Claude Code.