Occasionally, when pressing an arrow key (usually up) inside of a shell, the terminal or shell fails to output an
ESC character before the escape sequence, so if I press the up arrow to try and see the last command, it outputs
[A on bash and
OA on zsh, instead of the last command. It works correctly the next time I press the arrow key.
This happens regardless of the terminal emulator or shell used (but it does use
OA instead of
[A when using zsh).
I can't tell the exact circumstances this occurs in, it seems somewhat random, but it usually happens the next time I press an arrow after switching windows with my window manager (i3).
It's not because I pressed the key too fast after switching windows, because I can switch windows, type text into the shell, and after that press an arrow key and it will still output
It might be related to the fact that I'm using i3 as my window manager.
Is there anything I can do to fix or debug this issue?