파일을 열 때 gvim이 충돌하는 것을 어떻게 막을 수 있습니까?


12

Ubuntu Desktop 16.04 LTS를 사용 중이며 gvimGUI / 메뉴를 사용하여 파일을 열려고하면 그래픽 사용자 인터페이스가있는 vim이 계속 충돌합니다. 그러나 터미널에서 파일을 열 수있었습니다. 예 :

user@computer:~$ vim -g ./path/to/file

다음을 사용하여 터미널 gvim에서 vim -g시작한 후 GUI / 메뉴 표시 줄을 통해 파일을 열려고하면 충돌이 발생하면 다음 오류 메시지가 터미널에 인쇄됩니다 .

(gvim:20175): GLib-CRITICAL **: g_ptr_array_insert: assertion 'index_ <= (gint)rarray->len' failed

** (gvim:20175): CRITICAL **: unity_gtk_menu_shell_get_item: assertion '0 <= index && index < items->len' failed

** (gvim:20175): CRITICAL **: unity_gtk_menu_item_get_child_shell: assertion 'UNITY_GTK_IS_MENU_ITEM (item)' failed

** (gvim:20175): CRITICAL **: unity_gtk_menu_shell_get_item: assertion '0 <= index && index < items->len' failed

** (gvim:20175): CRITICAL **: unity_gtk_menu_item_get_label: assertion 'UNITY_GTK_IS_MENU_ITEM (item)' failed

** (gvim:20175): CRITICAL **: unity_gtk_menu_item_get_icon: assertion 'UNITY_GTK_IS_MENU_ITEM (item)' failed
Vim: Caught deadly signal SEGV
Vim: Finished.

이들은 내가 설치 한 vim 관련 패키지입니다.

user@computer:~$ apt list --installed | grep vim

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

vim-common/xenial-updates,now 2:7.4.1689-3ubuntu1.1 amd64 [installed]
vim-gtk3/xenial-updates,now 2:7.4.1689-3ubuntu1.1 amd64 [installed]
vim-gui-common/xenial-updates,xenial-updates,now 2:7.4.1689-3ubuntu1.1 all [installed,automatic]
vim-runtime/xenial-updates,xenial-updates,now 2:7.4.1689-3ubuntu1.1 all [installed,automatic]
vim-tiny/xenial-updates,now 2:7.4.1689-3ubuntu1.1 amd64 [installed]

답변:



5

vim-gtk3패키지 를 제거하고 패키지를 설치하여 충돌을 막을 수있었습니다 vim-gnome.

제거 vim-gtk3:

user@computer:~$ sudo apt remove vim-gtk3
[sudo] password for user: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-34 linux-headers-4.4.0-34-generic
  linux-image-4.4.0-34-generic linux-image-extra-4.4.0-34-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  vim-gtk3
0 upgraded, 0 newly installed, 1 to remove and 18 not upgraded.
After this operation, 2,948 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 336958 files and directories currently installed.)
Removing vim-gtk3 (2:7.4.1689-3ubuntu1.1) ...
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/rview (rview) in auto mode

설치 vim-gnome:

user@computer:~$ sudo apt install vim-gnome
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-34 linux-headers-4.4.0-34-generic linux-image-4.4.0-34-generic
  linux-image-extra-4.4.0-34-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libbonoboui2-0 libbonoboui2-common libgnome2-0 libgnome2-bin libgnomeui-0 libgnomeui-common
Suggested packages:
  cscope vim-doc fonts-dejavu
The following NEW packages will be installed:
  libbonoboui2-0 libbonoboui2-common libgnome2-0 libgnome2-bin libgnomeui-0 libgnomeui-common
  vim-gnome
0 upgraded, 7 newly installed, 0 to remove and 18 not upgraded.
Need to get 1,619 kB of archives.
After this operation, 5,536 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libgnome2-bin amd64 2.32.1-5ubuntu1 [5,040 B]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libgnome2-0 amd64 2.32.1-5ubuntu1 [1,656 B]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libbonoboui2-common all 2.24.5-3ubuntu1 [11.9 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libbonoboui2-0 amd64 2.24.5-3ubuntu1 [154 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libgnomeui-common all 2.24.5-3.1 [16.3 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libgnomeui-0 amd64 2.24.5-3.1 [207 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim-gnome amd64 2:7.4.1689-3ubuntu1.1 [1,223 kB]
Fetched 1,619 kB in 0s (3,435 kB/s)  
Selecting previously unselected package libgnome2-bin.
(Reading database ... 336954 files and directories currently installed.)
Preparing to unpack .../libgnome2-bin_2.32.1-5ubuntu1_amd64.deb ...
Unpacking libgnome2-bin (2.32.1-5ubuntu1) ...
Selecting previously unselected package libgnome2-0:amd64.
Preparing to unpack .../libgnome2-0_2.32.1-5ubuntu1_amd64.deb ...
Unpacking libgnome2-0:amd64 (2.32.1-5ubuntu1) ...
Selecting previously unselected package libbonoboui2-common.
Preparing to unpack .../libbonoboui2-common_2.24.5-3ubuntu1_all.deb ...
Unpacking libbonoboui2-common (2.24.5-3ubuntu1) ...
Selecting previously unselected package libbonoboui2-0:amd64.
Preparing to unpack .../libbonoboui2-0_2.24.5-3ubuntu1_amd64.deb ...
Unpacking libbonoboui2-0:amd64 (2.24.5-3ubuntu1) ...
Selecting previously unselected package libgnomeui-common.
Preparing to unpack .../libgnomeui-common_2.24.5-3.1_all.deb ...
Unpacking libgnomeui-common (2.24.5-3.1) ...
Selecting previously unselected package libgnomeui-0:amd64.
Preparing to unpack .../libgnomeui-0_2.24.5-3.1_amd64.deb ...
Unpacking libgnomeui-0:amd64 (2.24.5-3.1) ...
Selecting previously unselected package vim-gnome.
Preparing to unpack .../vim-gnome_2%3a7.4.1689-3ubuntu1.1_amd64.deb ...
Unpacking vim-gnome (2:7.4.1689-3ubuntu1.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Setting up libgnome2-bin (2.32.1-5ubuntu1) ...
Setting up libgnome2-0:amd64 (2.32.1-5ubuntu1) ...
Setting up libbonoboui2-common (2.24.5-3ubuntu1) ...
Setting up libbonoboui2-0:amd64 (2.24.5-3ubuntu1) ...
Setting up libgnomeui-common (2.24.5-3.1) ...
Setting up libgnomeui-0:amd64 (2.24.5-3.1) ...
Setting up vim-gnome (2:7.4.1689-3ubuntu1.1) ...
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/editor (editor) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/gvim (gvim) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/gview (gview) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/rgview (rgview) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/rgvim (rgvim) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/evim (evim) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/eview (eview) in auto mode
update-alternatives: using /usr/bin/vim.gnome to provide /usr/bin/gvimdiff (gvimdiff) in auto mode
Processing triggers for libc-bin (2.23-0ubuntu3) ...

1
vim-gnome이 이제 vim-gtk3으로의 전환 패키지이므로 17.04부터는 더 이상 작동하지 않습니다. 업데이트 된 해결 방법은 Ciro Santilli의 답변을 참조하십시오. Als 버그 bugs.launchpad.net/ubuntu/+source/vim/+bug/1650666
혼란

1
또한 17.04 (zesty) gvim 8.0 에서이 문제가 발생했습니다. vim-gtk3 (vim-gnome 제거)을 제거하고 vim-gtk를 설치하면이 버그에서 발견 된 버그가 수정되었습니다 .launchpad.net
michael

2

필자의 경우 먼저 설치된 gvim을 다음과 같이 제거했습니다.

sudo apt-get remove --auto-remove vim-gtk3

그런 다음 gvim을 다음과 같이 설치했습니다.

sudo apt install vim-gtk3-py2 

그건 그렇고, 나는 Vim8을 다음과 같이 사용하고 있습니다 :

sudo add-apt-repository ppa:jonathonf/vim
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.