Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 719132 - app-office/texstudio-2.12.22 Menu item "Tools / Open Terminal" does nothing
Summary: app-office/texstudio-2.12.22 Menu item "Tools / Open Terminal" does nothing
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: TeX project
URL: https://github.com/texstudio-org/texs...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-23 22:36 UTC by Jonas Stein
Modified: 2020-06-03 17:57 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Stein gentoo-dev 2020-04-23 22:36:40 UTC
The menu item "Tools / Open Terminal" does nothing.


Reproducible: Always
Comment 1 Wolfgang Müller 2020-04-24 00:14:09 UTC
I've had a look at the code at [1].

texstudio attempts to launch a terminal in two different ways:

1) It queries the "org.gnome.desktop.default-applications.terminal"
record through gsettings to find a terminal to use.

2) If gsettings is missing (or fails to look up the record), it falls
back to "konsole" and then "xterm".

Since gsettings is part of GLib, it will be available on almost all
systems, so we can generally assume that it will not be missing. If the
system in question has gnome-base/gsettings-desktop-schemas installed,
and has not overridden the default value, gsettings will *always* return
'gnome-terminal' successfully.

texstudio does not make an attempt at testing whether the application
returned by gsettings actually exists on the system. If it is missing,
the execution will simply fail.

As such, a solution would be to set default-applications.terminal to the
desired terminal app with `gsettings set <key> exec <app>'.

A couple of things to note:

1) The default-applications gschema hat itself deprecated the terminal
record [2], saying that "The default terminal is handled in GIO".

This means that GLib's AppInfo machinery is (or at least *should* be)
in charge of launching an appropriate terminal. AppInfo itself uses a
hardcoded list of terminal emulators [3] for this. See [4] for a
bug report and discussion on GLib's side.

2) As the terminal record is deprecated, GLib has no plan of relying on
it in the future. See also [5].

3) This does indeed mean (not only for texstudio) that the current
situation for most desktop environments is that there is no way for a
user to set their own desired terminal application short of sending a
patch upstream to GLib and having it added to the hardcoded list, or
patching GLib locally.

Given all of the above, texstudio's attempt to launch a terminal will
fail on almost all systems that do not have gnome-terminal installed.
Again, even if the fallback emulators exist on the system, they will not
be used as the successful call to gsettings will override that fallback.

I personally don't think setting default-applications.terminal to the
desired terminal application is a good solution. Frankly, right now, the
best way to handle this would be to have upstream use GIO instead of
trying to determine applications itself. That way it will work
(moderately) better right now, and will support user-defined default
terminals in the future once GLib decides on a way forward.

[1] https://github.com/texstudio-org/texstudio/blob/2.12.22/src/utilssystem_unix.cpp
[2] https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/blob/master/schemas/org.gnome.desktop.default-applications.gschema.xml.in#L50
[3] https://gitlab.gnome.org/GNOME/glib/-/blob/master/gio/gdesktopappinfo.c#L2546
	Note that this is missing most "modern" emulators like alacritty,
	kitty, et al.
[4] https://gitlab.gnome.org/GNOME/glib/issues/338
[5] https://gitlab.gnome.org/GNOME/glib/issues/338#note_205914
Comment 2 Jonas Stein gentoo-dev 2020-05-12 19:25:43 UTC
fixed upstream. It should work now in -9999
Comment 3 Larry the Git Cow gentoo-dev 2020-06-03 17:22:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1de944105f04f686590e858a8b47644ca32f8ed

commit f1de944105f04f686590e858a8b47644ca32f8ed
Author:     Jonas Stein <jstein@gentoo.org>
AuthorDate: 2020-06-03 17:20:35 +0000
Commit:     Jonas Stein <jstein@gentoo.org>
CommitDate: 2020-06-03 17:21:09 +0000

    app-office/texstudio: Version bump to 3.0.0_pre20200601
    
    This is a prerelease of TeXStudio 3.0.0. Upstream also known as alpha 6.
    It includes fixes for the following bugs
    
    Bug: https://bugs.gentoo.org/709464
    Bug: https://bugs.gentoo.org/719132
    Bug: https://bugs.gentoo.org/719132
    Package-Manager: Portage-2.3.100, Repoman-2.3.22
    Signed-off-by: Jonas Stein <jstein@gentoo.org>

 app-office/texstudio/Manifest                      |  1 +
 .../texstudio/texstudio-3.0.0_pre20200601.ebuild   | 85 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1de944105f04f686590e858a8b47644ca32f8ed

commit f1de944105f04f686590e858a8b47644ca32f8ed
Author:     Jonas Stein <jstein@gentoo.org>
AuthorDate: 2020-06-03 17:20:35 +0000
Commit:     Jonas Stein <jstein@gentoo.org>
CommitDate: 2020-06-03 17:21:09 +0000

    app-office/texstudio: Version bump to 3.0.0_pre20200601
    
    This is a prerelease of TeXStudio 3.0.0. Upstream also known as alpha 6.
    It includes fixes for the following bugs
    
    Bug: https://bugs.gentoo.org/709464
    Bug: https://bugs.gentoo.org/719132
    Bug: https://bugs.gentoo.org/719132
    Package-Manager: Portage-2.3.100, Repoman-2.3.22
    Signed-off-by: Jonas Stein <jstein@gentoo.org>

 app-office/texstudio/Manifest                      |  1 +
 .../texstudio/texstudio-3.0.0_pre20200601.ebuild   | 85 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)
Comment 4 Jonas Stein gentoo-dev 2020-06-03 17:57:33 UTC
Fixed in 3.0.0_pre20200601 upstream, which is now also in the tree. Closing.