When invoking vim through find | xargs, like this:
find . -name "*.txt" | xargs vim
you get a warning about
Input is not from a terminal
and a terminal with pretty much broken behaviour afterwards. Why is that?
|
feedback
|
|
When you invoke a program via $ true | xargs filan -s 0 chrdev /dev/null 1 tty /dev/pts/1 2 tty /dev/pts/1 $ true | xargs ls -l /dev/fd/ Vim expects its stdin to be the same as its controlling terminal, and performs various terminal-related ioctl's on stdin directly. When done on
You could consider this a bug in Vim, since it can open | ||||
|
feedback
|
|
Use GNU Parallel instead:
Or if you want to open all the files in one go:
It even deals correctly with filenames like:
Watch the intro video to learn more: http://www.youtube.com/watch?v=OpaiGYxkSuQ | |||||||||||||||
feedback
|
|
Following on from grawity's answer, From OSX/BSD
-o Reopen stdin as /dev/tty in the child process
before executing the command. This is useful
if you want xargs to run an interactive application.
Thus the following line of code should work for you: find . -name "*.txt" | xargs -o vim For GNU find ./ -name '*.txt' | xargs bash -c "</dev/tty /usr/bin/vim \$*" | |||
|
feedback
|