Vim 的 cscope 连接在每次 GNU 屏幕重新连接时都会中断
我在 C 开发环境中使用 cscope
运行 vim
。我在 freebsd 6.3 服务器上的 GNU screen 窗口中启动 vim,并使用 cs add ... 建立 cscope db 连接。在这个阶段,一切都完美无缺。
如果我分离屏幕会话并重新连接它,任何使用 cscope 的尝试都会导致 cscope 转储核心。这就是我从核心转储中得到的全部内容,因为我的 cscope 没有使用调试符号进行编译:
(gdb)
#0 0x480f45dc in ungetch () from /lib/libncurses.so.6
(gdb)
据我所知,当我重新连接到屏幕时,无需在 vim 上重新建立 cscope 连接。这将违背使用屏幕的目的。任何人都知道发生了什么事以及是否有解决方法?如果一切都失败了,我会找时间用符号编译 cscope 并找出发生了什么。
如果有帮助,我的 cscope DB 是通过以下方式生成的:
cscope -bkq -P`pwd` -i cscope.files
I run vim
with cscope
in my C development environment. I start vim
within a GNU screen
window on a freebsd 6.3 server and establish the cscope db connection with cs add ...
. At this stage everything works flawlessly.
If I detach the screen session and reattach it, any attempts to use cscope causes cscope to dump core. This is all I have from the core dump since my cscope is not compiled with debug symbols:
(gdb)
#0 0x480f45dc in ungetch () from /lib/libncurses.so.6
(gdb)
AFAIK there is no need to re-establish the cscope connection on vim when I reattach to screen. That would defeat the purpose of using screen. Anyone knows whats going on and if there is a workaround? If everything fails, I'm going to find time to compile cscope with symbols and figure out whats going on.
If it helps, my cscope DB is generated with:
cscope -bkq -P`pwd` -i cscope.files
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,这是 cscope 15.7a 中修复的问题。在这里发布答案,以防其他人遇到同样的问题(在我决定在这里发布之前,它困扰了我几年)。
Turns out that this is an issue fixed in cscope 15.7a. Posting an answer here in case someone else has the same issue (it bothered me for a couple of years before I decided to post here).
鉴于它在诅咒中崩溃,即使
vim
将调用cscope -l
(行模式),我认为猜测TERM=screen
是合理的code> 与您的问题有关。我会尝试制作一个包装器(例如在$HOME/bin
中,假设它位于路径中的/usr/local/bin
之前)来更改它:如果不是从 tty 运行,则为假术语”。 tty 测试是为了尝试避免破坏交互使用。您也可以尝试
TERM=none
或其他值。Given that it's crashing in curses even though
vim
is going to invokecscope -l
(line mode) I think it is reasonable to guess thatTERM=screen
is related to your problem. I'd try making a wrapper (for example in$HOME/bin
, assuming that's before/usr/local/bin
in your path) to change it:Which says "if not running from a tty, fake TERM". The tty test is to try and avoid breaking interactive use. You could try
TERM=none
or other values as well.