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

do_filter() behaves differently under nvim than vim (less doesn't work) #1386

Closed
aktau opened this issue Nov 3, 2014 · 7 comments
Closed
Labels
closed:wontfix current behavior is by design, and change is not desired environment user system environment (terminal, shell, tmux)

Comments

@aktau
Copy link
Contributor

aktau commented Nov 3, 2014

Interested in how the new do_filter -> os_call_shell -> ... chain was working out for is, I tried a few things in the source directory:

$ vim
:!less CMakeLists.txt
# can scroll around and do other things that less does

$ ./build/bin/nvim
:!less CMakeLists.txt
# less prints the entire file and then exits, being indistinguishable from cat

I tried to run it directly from the commandline (wrongly) and got this assertion:

➜  neovim git:(master) ./build/bin/nvim -s ":less CMakeLists.txt"
Cannot open for reading: ":less CMakeLists.txt"
Assertion failed: (0), function uv_close, file /Users/aktau/github/neovim/neovim/.deps/build/src/libuv/src/unix/core.c, line 160.
[1]    806 abort      ./build/bin/nvim -s ":less CMakeLists.txt"

ping @tarruda, any ideas? (the regular vim used was 7.4.488).

@tarruda
Copy link
Member

tarruda commented Nov 3, 2014

This was probably introduced in #1365 because os_call_shell no longer lets the child process inherit nvim std file descriptors. less is simply one of the programs that behave differently if stdout is a tty.

Essentially this is the same problem reported in #1044: While it could be easily fixed at the moment, it will stop working once Nvim externalizes its UI, because it no longer will be a terminal program.

@aktau
Copy link
Contributor Author

aktau commented Nov 3, 2014

This was probably introduced in #1365

I had an inkling. I'm wondering if this sort of feature is being used by a lot of people... since we don't be able to emulate it with nvim as a server.

@aktau
Copy link
Contributor Author

aktau commented Nov 3, 2014

@tarruda what about emulating a pty and updating a dynamic buffer? That would it could possibly work with remote clients as well.

@tarruda
Copy link
Member

tarruda commented Nov 3, 2014

I'm wondering if this sort of feature is being used by a lot of people

If there are, then these people won't be losing a lot by migrating to nvim. Here's a way of invoking a terminal program from Nvim that currently that works: <ctrl+z>less CMakeLists.txt<cr>

This feature is as useful as the :shell command which was removed from Nvim some months ago. I won't be surprised if this feature is broken in gVim as the :shell command was.

@tarruda what about emulating a pty and updating a dynamic buffer? That would it could possibly work with remote clients as well.

Yes, terminal emulation is something that fits well into a plugin, and could have a much cleaner implementation(no 'updatetime' hacks) in Nvim, though right now this would probably require python for it's pty libraries.

@aktau
Copy link
Contributor Author

aktau commented Nov 4, 2014

If there are, then these people won't be losing a lot by migrating to nvim. Here's a way of invoking a terminal program from Nvim that currently that works: <ctrl+z>less CMakeLists.txt

True. Can this be triggered from a script? (the backgrounding, et cetera).

@tarruda
Copy link
Member

tarruda commented Nov 4, 2014

True. Can this be triggered from a script? (the backgrounding, et cetera).

The backgrounding can be entered with the :suspend command or simply mapping something to <c-z>, typing something on the command-line after backgrounding would more complicated

@justinmk justinmk added the environment user system environment (terminal, shell, tmux) label Dec 19, 2014
@justinmk justinmk added the closed:wontfix current behavior is by design, and change is not desired label Jun 28, 2015
@justinmk
Copy link
Member

Closing this as "wontfix", :term is the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:wontfix current behavior is by design, and change is not desired environment user system environment (terminal, shell, tmux)
Projects
None yet
Development

No branches or pull requests

3 participants