Skip to content

Conversation

@michel-slm
Copy link
Contributor

This is packaged in various Linux distros already: https://repology.org/project/xdg-terminal-exec/versions

and we can't assume that gnome-terminal is preinstalled anymore (CentOS Stream 10, RHEL 10 and derivatives, Fedora 47+ and Ubuntu have switched to ptyxis by default)

(not sure why the openSUSE version number is weird)

This is packaged in various Linux distros already: https://repology.org/project/xdg-terminal-exec/versions

and we can't assume that gnome-terminal is preinstalled anymore (CentOS Stream 10, RHEL 10 and derivatives, Fedora 47+ and Ubuntu have switched to ptyxis by default)

(not sure why the openSUSE version number is weird)

Signed-off-by: Michel Lind <[email protected]>
@michel-slm michel-slm force-pushed the use-xdg-terminal-exec branch from 0ddcd29 to be26861 Compare May 29, 2025 00:58

For GNOME 45 and newer, you need `xdg-terminal-exec` since on newer GNOME
releases we cannot assume `gnome-terminal` is preinstalled.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICS the xdg-terminal-exec is still a proposal, and not an accepted standard.

This may work on new installations, but has high potential of breaking existing ones. I, for one, use a openSUSE Tumbleweed, and while my distro is fully up to date, I don't have xdg-terminal-exec on my system.

Side note: There is no Fedora 47, and the openSUSE "version number" (I suppose you're referring to Tumbleweed, which is a rolling distro) is just date expression.

// Run shell immediately after executing the command to keep the terminal window open
// (see http://stackoverflow.com/q/3512055)
argv = ["gnome-terminal", "--", "bash", "-c", activeLine.bash + "; exec ${SHELL:=bash}"];
argv = ["xdg-terminal-exec", "--", "bash", "-c", activeLine.bash + "; exec ${SHELL:=bash}"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I'd only accept a commit that would test if xdg-terminal-exec was available and fall back to gnome-terminal otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants