vscode-neovim: bug: vs code now constantly auto switching to the output panel on multiline messages

Check the following:

  • I have checked the behavior after setting “vscode-neovim.neovimClean” in VSCode settings.
  • I have read the vscode-neovim docs.
  • I have searched existing issues.

Neovim version (nvim -v)

0.10.0

Operating system/version

MacOS 14.4

Describe the bug

In recent versions of this extension (> v1.13.1) the output panel gets focused whenever neovim outputs multiline messages. This behavior does not happen in v1.13.1, and is probably related to the “revamp messages output channel” PR (https://github.com/vscode-neovim/vscode-neovim/pull/2024) introduced in v1.14.

I use a neovim plugin (pounce) with this extension, and that plugin outputs multiline messages in the course of normal use, which has made this extension near unusable because it’s now constantly covering up the terminal window or otherwise refocusing things against my will.

VS code’s focusing behavior is quite aggressive and is not configurable (there are lot of longstanding issues about this in the vs code repo) so it would be nice to have a setting to disable this behavior in vscode-neovim

Related to: https://github.com/vscode-neovim/vscode-neovim/issues/2046 and https://github.com/vscode-neovim/vscode-neovim/issues/1812

Steps To Reproduce

  1. emit a multi-line message in neovim (:echom "test\n").
  2. The ouput panel pops up, taking over focus from whatever was visible previously

Expected Behavior

The extension behaves the same as it did in v1.13.1 and shows multiline output in the status bar area rather than the output channel

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 8
  • Comments: 19

Most upvoted comments

1. Set cmdheight to a higher value

2. Use Nvim 0.10 and above versions because cmdheight is unchangeable in Nvim 0.9

Same but without any plugins, I’m getting very annoyed when doing a search that don’t exist like /foobar and getting the vscode panel open with the messages:

search hit BOTTOM, continuing at TOP
E486: Pattern not found: foobar

This is builtin and I would expect this to work without disrupting the UI and my current focus.

Could you please reopen and change back this behavior?

@mike-rambil, I’ve test now, and adding ‘:set cmdheight=10’ to my init file solved it for me. Did you try that?

As of 1.96:

  "workbench.view.showQuietly": {
    "workbench.panel.output": true
  }

The statusbar can only show one line.

Proposal

It might be the case that we need to adjust a threshold so that the Output channel is only shown if there are >=2 EOL chars.

Thus this should not focus the Output channel:

:echom "test\n"

but this should:

:echom "test\ntest\n"

This behavior has existing for at least 1 year. Most likely, a recent PR may have regressed the threshold.

Does that mean there is a plan to fix that threshold?

We don’t need a setting. I have yet to see any explanation about why you think it makes sense for an Nvim plugin to display a long message but you expect vscode-neovim not to show it.

Personally I don’t mind it showing it once (similar to debug opening the panel when started), but then I would like it to respect my decision to close the panel and stay closed for future messages if I choose not to read the messages, rather than continuing to open after being closed.

So far, the only cases mentioned here are about 2-line messages. That shouldn’t exceed the threshold. But if a 3-line message is displayed by Nvim, it makes no sense to insist that vscode-neovim should not display it. Fix your plugins, in that case.

Messages should be displayed, but it should be the user’s choice to read them and not to have a panel automatically open. Many messages go into the output or sql console or debug console, but they don’t automatically open up the panel. I can choose to open the panel and read them if I desire.

I can’t reproduce that issue (with my personal config as well as with vscode-neovim.neovimClean), messages are not focused when a search fails.

Yes sorry about that, I was about to edit my post, the message panel opens but doesn’t actually steal focus.

The panel opening is still very annoying, as it takes a lot of UI space corresponding to the last time it was open. Imagine working on in vscode’s terminal with a maximized panel, then toggling it to go back on code, search foobar: now the panel opens, maximized, hiding everything I was doing 🥲

About your proposition, I’d much prefer avoiding the panel to open in all cases due to un-necessary UI disturbance, if there are multiple lines there could be a note in the statusline saying there are more lines with a way to open the messages panel 🤔 The current behavior could be a setting, but having something like this enabled by default feels like bad UX with the not-uncommon maximized panel case I just described.