Timeline for How can I suppress the "reading from STDIN" message from within Vim?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 25, 2018 at 8:37 | comment | added | Alexander Solovets |
Well, forget my previous message. The trick in the answer is in <(col -b) part. That's essentially some sophisticated version of cat for printing man pages, and you can finally get rid of the vim's message with echo test | vim < /dev/tty <(cat>
|
|
Oct 25, 2018 at 8:13 | comment | added | Alexander Solovets |
Great answer, but I'd like to clarify for @LéoLéopoldHertz준영 and others wondering why wouldn't echo test | vim < /dev/tty work. As you can read in stackoverflow.com/questions/8514735/…, /dev/tty stands for the standard input for the currently running process, and is different for each new process. In case of echo test ... /dev/tty corresponds to the terminal's standard input, which is essentially your keyboard, and thus the trick doesn't work. If you, for example, execute that line from a standalone process, it will work as it works with MANPAGER
|
|
Jan 15, 2017 at 20:32 | comment | added | Adam Katz | @LéoLéopoldHertz준영 -- zmo has illustrated why I didn't provide a new answer. | |
Jan 14, 2017 at 10:10 | comment | added | zmo |
The OP was asking explicitly about vim and not gvim. There are subtle differences between the two, as you can see in the quoted snippet. Also, using tricks involving chardev files (i.e. /dev/tty ) might depend on the terminal you're using, some terminals not respecting the standards.
|
|
Jan 14, 2017 at 1:38 | comment | added | Adam Katz |
Like @LéoLéopoldHertz준영, the tty trick didn't work for me (gvim gives an empty document, vim gets real confused with the keyboard inputs, but at least it doesn't receive a SIGSTOP). I've had more luck with echo "foo" | gvim /dev/stdin (although the non-GUI vim will still issue a complaint about that: Vim: Warning: Input is not from a terminal ).
|
|
Jul 1, 2016 at 5:51 | comment | added | Léo Léopold Hertz 준영 |
I cannot get the workaround echo "foo" | vim < /dev/tty work. Doing it gives [2]+ Stopped echo "foo" | vim < /dev/tty .
|
|
Sep 9, 2015 at 8:54 | comment | added | Christian Brabandt | see feature.h (it's done when ALWAYS_USE_GUI is not defined, so basically for all unix versions). | |
Sep 9, 2015 at 8:46 | comment | added | muru |
When is ALWAYS_USE_GUI defined, do you know?
|
|
Sep 9, 2015 at 8:42 | vote | accept | muru | ||
Dec 17, 2017 at 1:31 | |||||
Sep 9, 2015 at 8:09 | history | answered | zmo | CC BY-SA 3.0 |