March 15, 2007 at 5:49PM How to break your terminal horribly with Vim (under Ubuntu)
I’d a bunch of files I needed to edit quickly and they were scattered all over the filesystem, so I tried this:
find . -name readme.txt | xargs vim
Should be fine, right? Hah!
Vim complained “Warning: Input is not from a terminal”, and I thought to myself, “Hmmm... why’s that happening? After all, xargs is just building up a bunch of command line arguments, right?”
I edited all the files and exited the error, but my keyboard was left behaving oddly, so I ran reset to fix the problem. Did that help? Only a bit: it fixed a few of the problems, but backspace and a few other keys were still acting oddly.
Not sure what the problem is, but I’ve a sneaking suspicion that ncurses isn’t cleaning up after itself properly. Very, very odd.
1 On March 16, 2007 at 5:26, Revence 27 wrote:
Actually, it is more Vim’s problem than ncurses’ problem. Vim seems to give the same warning whenever output is not to the terminal, rather than input not coming from the terminal. Try:
vi ~/.vimrc(Scared of Textuality.) It complains the same way, when it just should be doing its thing, and sending out whatever it has (so that you see nothing). The panic is uncalled-for, I think. Methinks it has the problem.
2 On March 16, 2007 at 6:59, Revence 27 wrote:
As in, that was accidental Textuality. I mean the command between back-ticks. I suck horribly.
3 On March 16, 2007 at 8:17, Revence 27 wrote:
By now I am being an idiot. Sorry. Had to say, though, that the following doesn’t make Vim complain:
find . -name readme.txt -exec vi ;Almost-similar, and Vim co-operates.
4 On March 16, 2007 at 11:36, Keith wrote:
vi ~/.vimrcandvim ~/.vimrcnever cause any problems for me, so I’m not sure exactly what you’re talking about there. Good point on the use of find though and I’m not sure why it didn’t occur to me to use the -exec flag, though what you’re really thinking of is something more like this:$ find . -name readme.txt -exec vi {} +Which does precisely what I’d intended. find is a bit of a swiss army knife, and it’s easy to forget bits like that.
5 On March 16, 2007 at 13:15, Revence 27 wrote:
Actually, the back-ticks around the command
vi ~vimrcare eaten out, because they are part of Textuality syntax. So, I don’t mean the commands, I mean the commands between back-ticks on your shell. When the shell expects to return the output of the command. And the find command also got messed up, because the two curly braces after the vi word were eaten out by Textuality, and so was the back-slash before the semi-colon. I keep getting your format wrong, and I have no preview option. And neither is the manual (summary) close-by.6 On March 17, 2007 at 12:11, Keith wrote:
Why in the world you you ever do something like
`vim ~/.vimrc`? That make no sense.And for the umpteenth time, the manual is here.
7 On March 18, 2007 at 10:02, Revence 27 wrote:
Um, that was just an example, to show you that Vim seems to actually be giving you the wrong error message, because in the case of the back-ticks, it still gives the message. Seems like it is trying to say
output is not going to the terminal’. And you know,xargsprobably collects the output, so it can use it somehow, hence inciting the complaint from Vim.Sure, I read the manual, played about at the page, et cetera. But, the same reason I get more than one chance to compile is the same reason I get to make silly blunders here. I’ll keep it simple, alright. :-)
8 On March 18, 2007 at 10:04, Revence 27 wrote:
I give up. I use the back-tick to quote test, since time immemorial. It just slipped. I’m so friggin’ sorry! Please, don’t get pissed. Don’t eat me. :o(