Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Not in a mode" error from VimuxRunCommand in scroll mode #230

Closed
tradiff opened this issue Aug 18, 2024 · 3 comments · Fixed by #232
Closed

"Not in a mode" error from VimuxRunCommand in scroll mode #230

tradiff opened this issue Aug 18, 2024 · 3 comments · Fixed by #232

Comments

@tradiff
Copy link
Contributor

tradiff commented Aug 18, 2024

I get the "not in a mode" error when using VimuxRunCommand while the Vimux pane is in scroll mode.

Repro Steps (confirmed on default tmux config):

  • In neovim, run :VimuxOpenRunner
  • in the new VImux pane run ls ~ to get some output
  • in the new Vimux pane, enter copy mode (C-b PgUp in default keybindings)
  • In neovim, run :VimuxRunCommand("ls")

The following error is displayed in neovim:

Error detected while processing function VimuxRunCommand[10]..VimuxSendKeys[2]..VimuxTmux[8]..function VimuxRunCommand[10]..VimuxSendKeys[2]..VimuxTmux:
line    8:
E605: Exception not caught: Tmux command failed with message:not in a mode

I get the same error when calling the tmux cli directly:

> tmux send-keys -t 2 q C-u
not in a mode   

This seems to be related to q C-u being sent together. If I run them as two separate commands, there is no error:

> tmux send-keys -t 2 q
> tmux send-keys -t 2 C-u

I realize splitting into separate commands might not be compatible with VimuxResetSequence being configured as a single string.

Here are some versions.

> tmux -V
tmux 3.4

> nvim -v
NVIM v0.10.1
Build type: RelWithDebInfo
LuaJIT 2.1.1707061634
Run "nvim -V1 -v" for more info

> alacritty --version
alacritty 0.13.2

vimux: (I don't know how to get neovim to tell me this, but it should be the latest master)

I'm happy to answer any other questions or make a screen recording if needed.

@tradiff tradiff changed the title "Not in a mode" error when in scroll mode "Not in a mode" error from VimuxRunCommand in scroll mode Aug 18, 2024
@gstokkink
Copy link

gstokkink commented Aug 20, 2024

Same here, using iTerm rather than alacritty.

@mvanderkamp
Copy link
Member

I can reproduce with regular vim as well, also tmux version 3.4. Thank you for the report!

It looks like tmux introduced a -q flag to copy-mode four years ago: tmux/tmux@06c3079

I propose updating VimuxResetSequence to just be "C-u" and updating VimuxRunCommand to call copy-mode -q on the runner before sending the reset sequence. #232

@andrew-cybsafe
Copy link

I've added a note to the tmux 3.4 questions issue. tmux/tmux#3836 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants