tmux-plugins / vim-tmux-focus-events

Make terminal vim and tmux work better together.
MIT License
348 stars 23 forks source link

Crashes tmux server #32

Closed step- closed 3 years ago

step- commented 3 years ago

Thank you for your plugins.

I can reproduce this issue with tmux-3.1b, tmux-3.1 e94bd5c (2020.11.10's master), and vim 8.2.1805, vim 8.2.1943, vim 8.2.2000. The terminal is urxvt maximized.

With this plugin loaded the tmux server always crashed with a fatal error message, as explained below. When this plugin wasn't loaded the tmux server never crashed. "Crashed" means that the server catches an invalid event, emits a fatal error message and exits with status 1.

  1. Start the very first tmux client running my shell (zsh) -- tmux server wasn't running yet.
  2. Maximize the terminal, run vim somefile, press o to insert a new line and leave it there.
  3. Switch to another window -- in my case it's always a maximized chromium if that matters.

At this point urxvt disappears from the screen with vim inside it. Looking at the tmux server's log (enabled with SIGUSR2) I can see that the tmux server has closed with status 1 and a "fatal" error message, "invalid key modifier". See the attached log file. The log's tail reads:

1605644748.249732 screen_write_collect_flush: flushed 0 items (0 bytes) (screen_write_stop)
1605644748.249741 screen_write_stop: 0 cells (0 written, 0 skipped)
1605644748.249774 unref client 0x832c00 (2 references)
1605644748.249781 status_redraw exit: force=0, changed=0
1605644748.249791 /dev/pts/1: redraw added 0 bytes
1605644748.249799 server_client_reset_state: client /dev/pts/1 mode 8c5d
1605644748.249808 server_client_reset_state: cursor to 4,0
1605644748.249818 server_client_check_pane_buffer: pane %0 is on
1605644748.249828 @0 active pane not changed
1605644752.907582 /dev/pts/1: read 3 bytes (already 0)
1605644752.907606 /dev/pts/1: keys are 3 (\033[O)
1605644752.907614 /dev/pts/1: next key is 3 (\033[O) (expired=0)
1605644752.907622 /dev/pts/1: keys in list: 0x1000000001
1605644752.907628 /dev/pts/1: complete key \033[O 0x1000000001
1605644752.907643 cmdq_append </dev/pts/1>: [server_client_key_callback/0x84faf0]
1605644752.907653 cmdq_next <global>: empty
1605644752.907659 cmdq_next </dev/pts/1>: enter
1605644752.907665 cmdq_next </dev/pts/1>: [server_client_key_callback/0x84faf0] (1), flags 0
1605644752.907671 session $0 0 activity 1605644752.907668 (last 1605644739.558602)
1605644752.907679 cmd_find_from_client: s=$0 0
1605644752.907684 cmd_find_from_client: wl=1 1 w=@0 vim
1605644752.907688 cmd_find_from_client: wp=%0
1605644752.907692 cmd_find_from_client: idx=none
1605644752.907698 session 0 not pasting
1605644752.907704 key table root (pane %0)
1605644752.907710 key table root (pane %0)
1605644752.907714 not found in key table root
1605644752.907721 writing key 0x1000000001 (FocusOut) to %0
1605644752.907734 fatal: invalid key modifiers: 1000000001

tmux-server-23005.log.tar.gz

step- commented 3 years ago

Stop the press! The server just crashed when this plugin wasn't loaded, and logged the same error message. I'm closing this issue right away as it doesn't pertain to this plugin. Sorry for any inconvenience.