在做了grep,并将其传递给vim然后退出,为什么我经历这个奇怪的控制台故障? [英] After doing grep and passing it to vim then quitting, why am I experiencing this weird console malfunctioning?

查看:299
本文介绍了在做了grep,并将其传递给vim然后退出,为什么我经历这个奇怪的控制台故障?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚才尝试过:

grep -RlI "id=\"kw\"" * | xargs vim

这给了我16个结果。它在Vim中打开了第一个结果。我做了我的第一次编辑,并命中:q ,因为我不知道快捷方式跳到下一个文件。

That gave me 16 results. It opened the first result in Vim. I made my very first edit and hit :q since I didn't know the shortcut to jump to the next file.

它让我回到控制台(我SSH连接到服务器)。我的控制台现在搞乱了。我输入的任何东西我看不到,并且任何时候我打入它似乎它处理命令,但显示/视图被拧紧了

It threw me back to the console ( I am SSHed in to a server ). My console is messed up now. Anything I type I can't see, and anytime I hit enter it seems like it processes the command but the display/view is screwed up so

[meder @ linode] 是在我的控制台上,至少在中间。 reset 什么都不做,因为它似乎弄乱了我的真实控制台。

[meder@linode] is tabbed in on my console, at least halfway. reset does nothing since it seems to have messed up my real console.


任何人都可以提供一个没有同样缺点的解决方案吗?或者任何人都可以提供一个解释为什么:q 从我的控制台第一个文件混乱了?

Can anyone offer a solution that doesn't have this same downside? Or can anyone provide an explanation for why :qing out of the very first file messed up my console?


背景资讯:我的电脑是 Debian Ubuntu,我打开的文件是text / ascii文件phtml / php文件,而不是一些奇怪的二进制文件中有疯狂的字符。

Background information: My PC is Debian Ubuntu, I am SSHed into a RHEL box. The files I opened were text/ascii files phtml/php files and not some weird binary files with crazy characters in them.

这是一个截图发生了什么

编辑#1: code> reset ,它似乎工作。第一个 reset 没有工作,我认为,因为不知怎的控制台插入一些whitespaceish字符里面?

EDIT #1: I just typed reset again and it seemed to work. The first reset did not work I think because somehow the console inserted some whitespaceish character inside it? Anyways, I would like an explanation for this weird behaviour.

推荐答案

尝试:

vim -o `grep -RlI "id=\"kw\"" * `

这篇关于在做了grep,并将其传递给vim然后退出,为什么我经历这个奇怪的控制台故障?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆