Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come whenever I run 'gvim' from Terminal in Ubuntu 10.04 Linux, I get a GLib-GObject-CRITICAL gvim error?

When I run gVim from Terminal in Ubuntu 10.04 with Gnome I get this error:

(gvim:6226): GLib-GObject-CRITICAL **: g_object_ref: assertion `object->ref_count > 0' failed

It looks like that everytime except that the number in between the parans (gvim: ) is always slightly different. How can I fix this with out having to run

gksudo gvim

?

which by the way starts gVim with out loading my .vimrc file and which is also annoying because of having to enter the password everytime.


1 Answers

Since gksudo gvim runs gvim as root it will not load the .vimrc in your home directory but rather the .vimrc in /root (if any).

So the problem is either in your ~/.vimrc or gksudo does not redirect the standard error stream.

Unfortunately, versions of gvim that are shipped with Ubuntu for example are known to spew GTK/GLib errors. I use the following alias in ~/.bashrc to ignore them:

alias gvim="gvim $@ &> /dev/null"
like image 85
Ton van den Heuvel Avatar answered Jan 03 '26 21:01

Ton van den Heuvel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!