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

Only last line of multi-line nvim_out_write appears when sent as notification #22878

Open
ddickstein opened this issue Apr 3, 2023 · 2 comments
Labels
api libnvim, Nvim RPC API bug issues reporting wrong behavior messages UI messages, log messages ui

Comments

@ddickstein
Copy link
Contributor

Problem

When nvim_out_write is called as a notification over RPC, only the last line is displayed.

Steps to reproduce

let sock = sockconnect("pipe", v:servername, { "rpc": 1 })
call rpcnotify(sock, "nvim_out_write", "foo\nbar\nbaz\n")

Expected behavior

I expect the output to be

foo
bar
baz
Press ENTER or type command to continue

but it is instead

baz

There is some possibility that this is by design, but if so this behavior difference needs to be documented (ideally w/ its motivation).

Neovim version (nvim -v)

v0.9.0-dev-1312+g908494889

Vim (not Nvim) behaves the same?

N/A

Operating system/version

Rocky Linux 8.6

Terminal name/version

xfce4-terminal 1.0.4

$TERM environment variable

tmux-256color

Installation

appimage

@ddickstein ddickstein added the bug issues reporting wrong behavior label Apr 3, 2023
@zeertzjq zeertzjq added ui api libnvim, Nvim RPC API labels Apr 3, 2023
@zeertzjq
Copy link
Member

You can use nvim_echo instead, which doesn't have this problem.

@zeertzjq zeertzjq added the needs:discussion For PRs that propose significant changes to some part of the architecture or API label May 20, 2023
@ddickstein
Copy link
Contributor Author

This affects the default LSP handler for window/showMessage, which uses nvim_out_write. Should that be changed to nvim_echo while this issue remains open?

@zeertzjq zeertzjq added the messages UI messages, log messages label Apr 29, 2024
@zeertzjq zeertzjq removed the needs:discussion For PRs that propose significant changes to some part of the architecture or API label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API bug issues reporting wrong behavior messages UI messages, log messages ui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants