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

Weird output when running a system command with vim.cmd via a mapping #28562

Open
mihaifm opened this issue Apr 29, 2024 · 4 comments
Open

Weird output when running a system command with vim.cmd via a mapping #28562

mihaifm opened this issue Apr 29, 2024 · 4 comments
Labels
bug issues reporting wrong behavior messages UI messages, log messages
Milestone

Comments

@mihaifm
Copy link
Contributor

mihaifm commented Apr 29, 2024

Problem

When using a mapping to run a system command, the first row of the output is mixed with the command name.

Steps to reproduce

nvim --clean
:lua vim.keymap.set('n', 'gz', function() vim.cmd('!echo abc') end)

Press gz

Output:

abccho abc

Expected behavior

Expected output (which is shown when running the command directly):

:!echo abc
abc

Neovim version (nvim -v)

NVIM v0.10.0-dev-3036+gab1c2220f

Vim (not Nvim) behaves the same?

no

Operating system/version

linux, windows

Terminal name/version

all terminals

$TERM environment variable

Installation

binary

@mihaifm mihaifm added the bug issues reporting wrong behavior label Apr 29, 2024
@zeertzjq zeertzjq added the messages UI messages, log messages label Apr 29, 2024
@zeertzjq
Copy link
Member

Related #22878

@mihaifm
Copy link
Contributor Author

mihaifm commented Apr 29, 2024

Strangely I get the same behavior by running

:execute "normal :!echo abc\n"

In Vim this doesn't keep the popup open, so I guess it's still a Neovim issue.

@zeertzjq
Copy link
Member

Hmm, that happens with :execute "normal :echo 111 | echo 222\n" too.

@justinmk justinmk added this to the backlog milestone Apr 29, 2024
@zeertzjq
Copy link
Member

Also related: #20673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior messages UI messages, log messages
Projects
None yet
Development

No branches or pull requests

3 participants