Emacs - 光标错位和消失的文本
我已经在工作中使用 emacs 的副本(在 Debian VM 中,我通过 putty 进行 ssh 访问)已经有几个月了,到目前为止,一切都运行良好......但是今天早上我正在尝试编辑shell 脚本模式下的文件,并且我看到光标周围的文本有一些奇怪的行为。
基本上,当我键入以下内容时( [ ] 代表我的光标):
export DATABASE[]
在键入变量名称的前几个字符后,导出语句消失并且变量名称与左边距对齐,我最终看到的是 (光标在荒野中):
DATABASE []
如果我然后按 CTRL-L,屏幕刷新,我看到应该显示的文本......直到我开始打字,然后缓冲区再次开始奇怪的行为(字符消失,移动,光标结束 据我所知,我没有在
我的 .emacs 文件中添加任何内容,因为这最后一次按照我的预期工作,所以我不知道这里可能发生什么。它似乎也不是特定于 sh-mode - 我测试了一些其他文件类型并观察到类似的奇怪行为。是否有任何 emacs 爱好者可以为我指明正确的方向,以找出这里出了什么问题?
提前致谢
I've been using a copy of emacs (in a Debian VM I ssh to with putty) at work for a couple of months now, and up until now everything has been working brilliantly... but this morning I'm trying to edit a file in shell-script-mode, and am seeing some weird behavior with text around the cursor.
Basically, when I type the following ( [ ] represents my cursor):
export DATABASE[]
After I've typed the first few characters of the variable name the export statement disappears and the variable name aligns to the left margin, and all I end up seeing is (with the cursor out in the wilderness):
DATABASE []
If I then hit CTRL-L, the screen refreshes, and I see the text as it should be displayed... until I start typing, and then the buffer start acting strangly again (characters disappearing, moving, cursor ending up in the wrong place, etc)
I've not, to my knowledge, added anything to my .emacs file since this last worked as I expect it to, so I'm at a loss as to what could be happening here. It doesn't seem specific to sh-mode either - I've tested a few other file types and observed similar strange behavior. Are there any emacs afficianados out there who might be able to point me in the right direction to figure out what's wrong here?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道该建议什么,但这听起来非常像终端的问题:我怀疑 Emacs 会在当前行发生变化时重新绘制它,并且我猜它会尝试增量地这样做。如果你的终端出了问题,那么当前单词很可能会写在行的开头(所有 Emacs 都已发送),并且你的光标将被遗弃在“荒野中”:-)
显然,这是一个新的变化。由于这听起来不像是由 .emacs 中的 Elisp 配置引起的问题,因此您应该检查您最近是否升级了
然后也许是相关工具变更日志中会有一些内容(也许您可以通过配置禁用?)
您可以检查一件事:您说这不仅仅是 SH 模式。是“任何带有语法高亮的模式”吗?也许 Emacs 只是通过网络发送具有当前颜色的文本?
I'm not sure what to suggest, but this sounds awfully like an issue with the terminal: I suspect that Emacs redraws the current line whenever it changes and I guess it tries to do so incrementally. If something's got out of whack with your terminal, then it seems quite plausible that the current word would get written at the start of the line (all Emacs sent) and your cursor would get abandoned "out in the wilderness" :-)
Obviously, this is a new change. Since it doesn't sound like the sort of issue that would be caused by Elisp configurations in your .emacs, you should check whether you've recently upgraded one of
Then maybe the relevant tool will have something in the changelog (which maybe you can disable via a config?)
One thing you could check: you say this isn't just SH-mode. Is it "any mode with syntax highlighting"? Maybe Emacs just sends over the wire the text with the current colour?
在 shell 窗口中运行 ABCL LISP 时,使用 PuTTY / Emacs / Remote AWS Ubuntu 时,我遇到了类似的文本消失问题。
解决方案是:我在 PuTTY 中更改了前景和背景字体颜色(基本上颠倒了),但忽略了更改粗体字体,因此它们消失在背景中。
I had a similar problem of disappearing text using PuTTY / Emacs / Remote AWS Ubuntu when running ABCL LISP in a shell window.
The solution was: I had changed my foreground and background font colors (essentially reversed) in PuTTY but had neglected to change the bold fonts, so they were disappearing into the background.