coq_nvim
coq_nvim copied to clipboard
COQnow fails in tmux after upgrading to Fedora 39
After upgrading to Fedora 39, coq_nvim cannot be started in tmux, as the following error is returned:
not enough values to unpack (expected 7, got 1)
Traceback (most recent call last):
File "/home/vincenzo/.local/share/nvim/lazy/coq_nvim/.vars/runtime/lib64/python3.10/site-packages/pynvim_pp/logging.py", line 31, in suppress_and_log
yield None
File "/home/vincenzo/.local/share/nvim/lazy/coq_nvim/coq/clients/tmux/worker.py", line 41, in _poll
await self.periodical()
File "/home/vincenzo/.local/share/nvim/lazy/coq_nvim/coq/clients/tmux/worker.py", line 49, in periodical
current, panes = await snapshot(
File "/home/vincenzo/.local/share/nvim/lazy/coq_nvim/coq/tmux/parse.py", line 114, in snapshot
shots = await gather(*(_screenshot(tmux, pane=pane) for pane in panes))
File "/home/vincenzo/.local/share/nvim/lazy/coq_nvim/coq/tmux/parse.py", line 80, in _panes
File "/home/vincenzo/.local/share/nvim/lazy/coq_nvim/coq/tmux/parse.py", line 60, in cont
session,
I took a look at the worker.py and parse.py and I figured out that the issue stems from the splitting of the output of the systemd-run command:
https://github.com/ms-jpq/coq_nvim/blob/d4a58fa7ab20c928f88e416b3fcf6ada965bf314/coq/tmux/parse.py#L57-L67
Actually, the output of the command is something like this $0\037%0\0370\0370\037nvim\0370\037fedora
, which cannot be splitted using \x1f
as separator.
Workaround
I solved this issue, at least on my system, by encoding the command output to bytes using UTF-8, and then decoding it back into a Unicode string, as below
def cont() -> Iterator[Pane]:
for line in decode(proc.stdout).encode('utf-8').decode('unicode_escape').strip().splitlines():
(
session,
pane_id,
session_name,
window_index,
window_name,
pane_index,
pane_title,
) = line.split(_SEP)
Having the same problem
For me it does not even start without tmux. I am using fedora 39. I get the same error:
not enough values to unpack (expected 7, got 1)
Traceback (most recent call last):
File "/home/jab/.local/share/nvim/lazy/coq_nvim/.vars/runtime/lib64/python3.12/site-packages/pynvim_pp/logging.py", line 31, in suppress_and_log
yield None
File "/home/jab/.local/share/nvim/lazy/coq_nvim/coq/clients/tmux/worker.py", line 41, in _poll
await self.periodical()
File "/home/jab/.local/share/nvim/lazy/coq_nvim/coq/clients/tmux/worker.py", line 49, in periodical
current, panes = await snapshot(
^^^^^^^^^^^^^^^
File "/home/jab/.local/share/nvim/lazy/coq_nvim/coq/tmux/parse.py", line 113, in snapshot
panes = await _panes(tmux, all_sessions=all_sessions)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jab/.local/share/nvim/lazy/coq_nvim/coq/tmux/parse.py", line 79, in _panes
return tuple(cont())
^^^^^^^^^^^^^
@vincenzocaputo Thank you! I was having the same problem. Your workaround works for me.