Ubuntu – howto prevent gedit always opening a new unnamed file when launched

gedit

Is there a way to prevent gedit from always opening a new "untitled" file when launched (at least when an other file name is passed either with Alt+F2 and gksudo)? It is borring to always have to click "don't save" for this null file with nothing typed in it.
Thank you

Best Answer

This is a bug as you can see here: https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/796076 and it doesn't look like it will be fixed because apparently, GNOME developers don't want users to run any application as root.

A work-around is to use "gksu" (or "gksudo") twice, like this:

gksu gksu gedit /path/to/file

You can make an alias so you don't have to run this twice. To do this, open ~/.bashrc and add this:

alias gksudo='gksudo gksudo'
alias gksu='gksu gksu'

Then, save the file and run this to source the ~/.bashrc file:

. ~/.bashrc
Related Question