Ubuntu – Gtk warning when opening Gedit in terminal

geditgtk

Previously, I need to clear documents history, so I Googled and found this:

http://www.watchingthenet.com/ubuntu-tip-clear-disable-recent-documents.html

I did the step, and then when I opened gedit in root terminal, I've got this:

root@dellph1-desktop:/# gedit

(gedit:8224): GLib-CRITICAL **: g_bookmark_file_load_from_data: assertion `length != 0' failed

(gedit:8224): Gtk-WARNING **: Attempting to store changes into `/root/.recently-used.xbel', but failed: Failed to rename file '/root/.recently-used.xbel.FP7PPV' to '/root/.recently-used.xbel': g_rename() failed: Operation not permitted

(gedit:8224): Gtk-WARNING **: Attempting to set the permissions of `/root/.recently-used.xbel', but failed: Operation not permitted
root@dellph1-desktop:/# 

And it's happpened in user terminal:

dellph1@dellph1-desktop:~$ gedit

(gedit:9408): Gtk-CRITICAL **: gtk_accel_label_set_accel_closure: assertion `gtk_accel_group_from_accel_closure (accel_closure) != NULL' failed
dellph1@dellph1-desktop:~$ 

I really hope someone helps in this case, thank you.

Best Answer

  • Use this

    (nohup gedit 2>/dev/null &)
    

    This runs gedit in the background in a sub-shell, with nohup. Hence, the error messages are handled by nohup, and closing the terminal wouldn't affect gedit. A simpler way would be:

    gedit &> /dev/null
    

    This just discards any error messages from gedit.