How can gedit be forced to open a new window independently of existing gedit windows whenever a text file (.txt) is double-clicked on a Gnome desktop of Debian 8, Jessie?
Suppose that a.txt is already open in a gedit window, and that b.txt is double-clicked on a Gnome desktop of Debian 8 Jessie. Then, unfortunately, by the factory default, b.txt will be opened in a tab in the same window as a.txt.
However, I want b.txt to be opened in a new window of gedit so that there will be two windows - the existing window for a.txt and a new window for b.txt.
If Gnome invoked gedit with the "-s" option as in
gedit -s b.txt
then b.txt would be opened in a new window, while a.txt stays in its existing window.
However, by default, Gnome seems to invoke gedit without the "-s" option.
The configuration file
/usr/share/applications/org.gnome.gedit.desktop
contains the execution directive
Exec=gedit %U
So, I changed it to
Exec=gedit -s %U
by the following commands, and restarted the computer.
cd /usr/share/applications
su # similar to sudo
mv org.gnome.gedit.desktop org.gnome.gedit.desktop.bak
perl -pe 's/Exec=gedit %U/Exec=gedit -s %U/' org.gnome.gedit.desktop.bak > org.gnome.gedit.desktop
diff org.gnome.gedit.desktop org.gnome.gedit.desktop.bak
However, this method has failed. The b.txt still opens in a tab in the same window as a.txt. I am stuck. I need your help.
The default mode of gedit is "single window, multiple tabs". I want the "multiple windows" mode.
By the way, the following useless method turns gedit into the "single window, no tab" mode, which is not what I want.
gsettings set org.gnome.gedit.preferences.ui show-tabs-mode 'never'
With this "gsettings" method, gedit automatically closes a.txt and reuses the existing window of a.txt to open b.txt in it whenever b.txt is double-clicked on a desktop. Thus, it is the "single window, no tab" mode (as opposed to "multiple windows").
(By the way, the default value for "show-tabs-mode" is 'auto'.)