When I do “locate 50local.policy | xargs vim”, I get the error “Vim: Warnung: Die Eingabe kommt nicht von einem Terminal” (translation: Vim: Warning: The input does not come from a terminal).
I can edit successfully with vim but after I close it my terminal behaves strangely (I can’t type letters and when I hit enter the shell prompt simply gets repeated.
When I do it with “xargs gedit” it does not create those problems.
I use Ubuntu 11.10 with Gnome 3 and Gnome-Terminal 3.0.1.
Vim expects to be connected to a real terminal and sends codes appropriate to that.
Reset the terminal with
The easiest workaround:
Otherwise:
Alternatively
You can dodge the issue by not starting vim with the arguments, but adding the arguments from vim! Vim is in fact a lot better at running shells than shells are at running vim.
Whilst in vim:
This sets the argument list to the files returned from the shell command between the ticks; :rewind then goes to the first file from that list.
If you were editing multiple matches, try this:
This sequence of commands (separated by |) writes the current buffer to file, then goes to the next file in the args list.