7

Everytime I close a gvim window with the little x on the window or Alt + F4. I get the following error and have to hit return to get my command prompt back. Has anyone seen this?

(gvim:26639): GLib-GObject-WARNING **: cannot retrieve class for invalid (unclassed) type `<invalid>'
Braiam
  • 69,112
bjackfly
  • 323

4 Answers4

24

vim-gnome has this problem, but vim-gtk does not, so this is a quick fix for the problem:

sudo apt remove vim-gnome
sudo apt install vim-gtk
4

Normally, GLib-GObject-WARNING while running gtk applications in the command line, are normally ignored by developers and demonstrate a poorly written applications. If you report a bug against the package, it would be the best, but don't act surprised if developers ignore or say that "is ok" in your bug report.

TL;dr: They are normally safe to be ignored.

Braiam
  • 69,112
1

I found myself caught between the spurious Warning (vim-gnome) or an empty file bug with vim-gtk3. Open an existing file, then try switching to a new file that doesn't exist using

:e newEmptyFile => SEGV

So I'm back to using vim-gnome with this hack in my ~/.bash_aliases to shutup vim-gnome:

alias gvim='gvim 2>/dev/null'

I'm sure it will get fixed soon and I won't have to keep throwing away all errors because of a persistent spurious warning.

swift
  • 3,291
0

Try

sudo update-alternatives --config gvim

then select /usr/bin/vim.gtk-py2

Zanna
  • 72,312