I have a workaround for those LTS users like me who haven't got the fixed
gedit. As stated if gksudo gksudo gedit is run, it doesn't create the empty
document. Therefore, adding this:
gksudo()
{
if [ "$1" = "gedit" ]
then
shift
gksudo gksudo gedit "$@"
else
command gksudo "$@"
fi
}
to your .bashrc will fix it. For those who don't know bash, it's a function
that will be called when the user types gksudo. If the second argument is
gedit, then it shifts the argument array, to drop off the first, and then
passes the argument array to gksudo gksudo gedit. (This makes sure that if the
users specifies a file to open it will get opened). Otherwise it just runs
gksudo for us.
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gedit in Ubuntu.
https://bugs.launchpad.net/bugs/796076
Title:
When run as root [gksudo gedit <whatever>] gedit tries to open a 2nd
'untitled document 1'
Status in Light-Weight Text Editor for Gnome:
Fix Released
Status in “gedit” package in Ubuntu:
Triaged
Bug description:
Binary package hint: gedit
Ex.
gksudo gedit /etc/fstab will open fstab successfully but will also try to
open "Untitled Document 1" at the same time
If just running gksudo gedit than you'll get "Untitled Document 1" that never
does fully open (become writable
== Regression details ==
Discovered in version: 3.0.4-0ubuntu2
Last known good version: 2.30.4-2ubuntu1
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gedit 3.0.4-0ubuntu2 [modified: usr/share/applications/gedit.desktop]
ProcVersionSignature: Ubuntu 2.6.38-9.43lp760131v201106060906-generic 2.6.38.7
Uname: Linux 2.6.38-9-generic i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Sat Jun 11 19:11:08 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
ProcEnviron:
LANGUAGE=en_US:en
PATH=(custom, user)
LANG=en_US.utf8
LC_MESSAGES=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: gedit
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/796076/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp