Search code examples
shelltmuxfish

Window focus adds characters to shell


This is a very strange bug that I can't seem to track down. I'm using the fish shell and after I launch and disconnect from a TMUX session, every time the window loses focus a "[O" is added to the prompt and every time the window gains focus a "[I" is added to the console. This means that if I cmd+tab to another window (or just click out of the window and back in) the prompt would look like: $ [O[I

EDIT: Pertinent information. This only seems to happen in the fish shell, not bash. It only happens after attaching to a tmux session (or making a new one) and the disconnecting. Opening a new window I do not have the issue.

Minor annoyance, but I just want to know what's going on.


Solution

  • Turns out this was because of the tmux set-option -g focus-events on setting being set by tmux-sensible plugin. This allows for you to pass on focus events to vim inside of tmux (which I don't do) the issue it seems is that it wasn't being turned off when tmux exited. I simply commented it out, as I don't use features that depend on it.