tmux / tmux

tmux source code
Other
35.09k stars 2.12k forks source link

70ff8cf breaks popular Neovim plugin Coq #3451

Closed vegerot closed 1 year ago

vegerot commented 1 year ago

Issue description

https://github.com/ms-jpq/coq_nvim/issues/544 describes a crash when starting the coq plugin in Neovim when using the latest version of tmux

Required information

Please provide the following information:

nicm commented 1 year ago

Commit 70ff8cf cannot possible cause anything to crash.

vegerot commented 1 year ago

@nicm would you please clarify what you said? Were you able to reproduce the hang?

vegerot commented 1 year ago

Maybe I got the exact commit wrong. It's somewhere in this range https://github.com/ms-jpq/coq_nvim/issues/544#issuecomment-1346966733

nicm commented 1 year ago

Does this still happen after 7cb48fc40b178d0b7bf281dee6799fa0e3745c70?

If so, please show the problem data tmux is sending (working and not working), also please show tmux logs.

shebpamm commented 1 year ago

Still happening for me on 0e28153

The specific problem is that the plugin is using a unicode escape character (\x1f) in the formatting string with tmux list-panes -F, similar to this: #{session_id}\x1f#{pane_id}\x1f#{pane_title}. See this example:

tmux 3.3a

# use printf to decode the \x1f, as it shows poorly on the terminal and github otherwise
$ printf "#{session_id}\x1f#{pane_id}\x1f#{pane_title}" | xargs -I{} tmux list-panes -F {}
> $0%0shebpamm@hexane: ~/dotfiles/config/nvim/lua/plugins

# Show special characters with python. It still has the special characters still there:
$ printf "#{session_id}\x1f#{pane_id}\x1f#{pane_title}" | xargs -I{} tmux list-panes -F {} | python -c "print(input().encode('utf-8'))"
> b'$0\x1f%0\x1fshebpamm@hexane: ~/dotfiles/config/nvim/lua/plugins'

tmux 3.4-next

# use printf to unescape the \x1f, as it shows poorly on the terminal and github 
$ printf "#{session_id}\x1f#{pane_id}\x1f#{pane_title}" | xargs -I{} tmux list-panes -F {}
> $0\037%0\037shebpamm@hexane: ~/dotfiles/config/nvim/lua/plugins

# Show special characters with python. It still has the special characters still there:
$ printf "#{session_id}\x1f#{pane_id}\x1f#{pane_title}" | xargs -I{} tmux list-panes -F {} | python -c "print(input().encode('utf-8'))"
> b'$0\\037%0\\037shebpamm@hexane: ~/dotfiles/config/nvim/lua/plugins'

Seems like the special character becomes escaped and also changes format in the newer version.

nicm commented 1 year ago

It isn't escaped, it is printed as \037 because it is nonprintable. Try using a different character or a tab instead.

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.