屏幕 + vim 导致 Shift-Enter 插入 'M' 和一个换行符

发布于 2024-07-04 12:00:05 字数 631 浏览 8 评论 0原文

当在 gnu 屏幕中运行 vim 实例时,在插入模式下按下 Shift Enter 会添加一个“M”,然后添加一个换行符,而不仅仅是一个换行符。

有谁知道问题可能是什么,或者去哪里查看?

相关系统信息:

Ubuntu 8.04.1

屏幕版本 4.00.03 (FAU) 2006 年 10 月 23 日

VIM - Vi IMproved 7.1(2007年5月12日,2008年1月31日12:20:21编译) 包含的补丁:1-138

Konsole 1.6.6(使用 KDE 3.5.10)

感谢评论。 在检查 $TERM 的值时,我注意到它是 xterm (如预期),但在屏幕内 $TERM 设置为 屏幕bce。 启动屏幕后设置 TERM=xterm 可以解决此问题。

将以下内容添加到 ~/.screenrc 解决了问题,而无需手动执行任何操作:

术语xterm

When running a vim instance in gnu screen hitting shift enter in insert mode adds an 'M' and then a newline, rather than just a newline.

Does anybody know what the problem might be, or where to look?

Relevant system info:

Ubuntu 8.04.1

Screen version 4.00.03 (FAU) 23-Oct-06

VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 31 2008 12:20:21)
Included patches: 1-138

Konsole 1.6.6 (Using KDE 3.5.10)

Thanks to the comments. When checking the value of $TERM I noticed that it was xterm (as expected), but within screen $TERM was set to screen-bce. Setting TERM=xterm after launching screen resolves this issue.

Adding the following to ~/.screenrc solved the problem without having to do anything manually:

term xterm

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冷︶言冷语的世界 2024-07-11 12:00:05

您的问题缺少信息:

  1. 您在哪里运行 screen 并看到此问题? 某些终端应用程序(KTerminal、Gnome 终端、虚拟控制台等)或远程会话(例如 putty、来自另一台计算机的 ssh)
  2. 执行“echo $TERM”并告诉我们其输出
  3. 执行“cat -v”,按 Shift-Enter,然后回车,然后 Ctrl-D 然后告诉我们输出什么。

Missing info from your question:

  1. Where do you run screen and see this issue? Some terminal app (KTerminal, Gnome terminal, virtual console etc) or remote session (eg putty, ssh from another computer)
  2. do a “echo $TERM” and tell us its output
  3. do a “cat -v”, press Shift-Enter, then Enter, then Ctrl-D and then tell us what is output.
迷雾森÷林ヴ 2024-07-11 12:00:05

首先,您可以在 konsole 内修复 $TERM。 安装“ncurses-term”并配置 konsole 以设置 $TERM=konsole-256color。 然后使用“term screen-256color”配置屏幕。 或者分别是“konsole”和“screen”,如果您愿意的话。 Konsole 和 screen 不是 xterm,也不支持 xterm 的所有功能,因此使用不正确的 $TERM 可能会导致不好的结果。

First, you could fix your $TERM for within konsole. Install "ncurses-term" and configure konsole to set $TERM=konsole-256color. Then configure screen with "term screen-256color". Or 'konsole' and 'screen', respectively, if that's your preference. Konsole and screen are not xterm and doesn't support everything xterm does, so using incorrect $TERM can lead to bad things.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文