Upgrade to Ubuntu 25.04 do not respect x-terminal-emulator settings

Bug #2107326 reported by Pavel Selivanov
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xdg-terminal-exec (Ubuntu)
Fix Released
Medium
Alessandro Astone
Plucky
Won't Fix
Medium
Alessandro Astone

Bug Description

[ Impact ]

In previous Ubuntu versions I just set x-terminal-emulator alternative to ghostty, and Gnome correctly launched the configured terminal with default shortcut of Ctrl+Alt+T.
After upgrading the system to a 25.04, Gnome 48 seems to ignore this setting, and launches default Gnome Terminal when shortcut is pressed.

That happens because Ubuntu Desktop 25.04 now uses `xdg-terminal-exec` to configure the user's default terminal application, which is an improvement over the previous `x-terminal-emulator` way (see the MIR bug 2069308)

The user configuration is not migrated from x-terminal-emulator to xdg-terminal-exec, so the user finds their default terminal reset to the default GNOME Terminal.

[ Test Plan ]

1. Install Ubuntu Desktop 24.10 or prior
2. Change the default terminal through x-terminal-emulator
3. Ensure that Ctrl+Alt+T launches the configured terminal application
4. Upgrade to Ubuntu 25.04
5. Install the xdg-terminal-exec update
5. Verify that Ctrl+Alt+T launches the same terminal application

[ Where problems could occur ]

This is implemented as a session-migration script.
The script is implemented with a defensive programming approach so that the xdg-terminal-exec configuration is written if and only if the user had previously changed the x-terminal-emulator config and did not already change the xdg-terminal-exec config.

Due to an issue with GNOME Terminal being too excited about setting itself as the default xdg-terminal-exec even before xdg-terminal-exec was used for launching the terminal in Ubuntu, the configuration will only be applied if both /usr/bin and $HOME live in filesystems which support the file creation timestamp (not necessarily the same one).

[ Other info ]

ProblemType: Bug
DistroRelease: Ubuntu 25.04
Package: gnome-shell 48.0-1ubuntu1
ProcVersionSignature: Ubuntu 6.14.0-15.15-generic 6.14.0
Uname: Linux 6.14.0-15-generic x86_64
NonfreeKernelModules: zfs
ApportVersion: 2.32.0-0ubuntu5
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Mon Apr 14 13:46:12 2025
DisplayManager: gdm3
InstallationDate: Installed on 2022-04-28 (1082 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
RelatedPackageVersions: mutter-common 48.1-1ubuntu3
SourcePackage: gnome-shell
UpgradeStatus: Upgraded to plucky on 2025-04-11 (3 days ago)

Related branches

Revision history for this message
Pavel Selivanov (muiriled) wrote :
Revision history for this message
Alessandro Astone (aleasto) wrote :

This is somewhat intended, because now the default terminal emulator is handled by xdg-terminal-exec

Perhaps we should provide an upgrade path so that users don't lose their previous defaults?

no longer affects: gnome-shell (Ubuntu)
Changed in xdg-terminal-exec (Ubuntu):
status: New → Opinion
summary: - Gnome 48 in Ubuntu 25.04 do not respect x-terminal-emulator settings
+ Upgrade to Ubuntu 25.04 do not respect x-terminal-emulator settings
Revision history for this message
Jeremy Bícha (jbicha) wrote :

x-terminal-emulator only exists on Debian-based systems and is unsuitable for the user's default terminal because x-terminal-emulator can only be set system-wide (using the Debian alternatives system). xdg-terminal-exec allows for different users to have different default terminals on the same system.

I currently have my default terminal set to Ptyxis. This is done by having this line in
~/.config/ubuntu-xdg-terminals.list

org.gnome.Ptyxis.desktop

I don't have ghostty installed so I'm not sure what the .desktop name is. Maybe this works?

com.mitchellh.ghostty.desktop

I understand that it would be nice to users to make it easier to customize their default terminal. I filed https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/3374 and it looks like it has the support of the GNOME Design team. It just needs a developer to implement the idea.

Revision history for this message
Pavel Selivanov (muiriled) wrote (last edit ):

Thanks a lot Jeremy!

Setting

com.mitchellh.ghostty.desktop

in ~/.config/ubuntu-xdg-terminals.list worked.

And you're also right, that default terminal app should be configurable in Settings, as a lot of people gonna be upset as soon as 25.04 will release and old settings won't work with no clear path of how to deal with it.

Internet is full of recipes to change default terminal with:

sudo update-alternatives --config x-terminal-emulator

And since it was broken in Ubuntu 25.04 first, there should be some way to inform people how to deal with it now.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

The Ubuntu 25.04 Release Notes do mention xdg-terminal-exec. At your suggestion, I have added a link to this bug.

https://discourse.ubuntu.com/t/plucky-puffin-release-notes/48687

Revision history for this message
Nick Rosbrook (enr0n) wrote :

> Perhaps we should provide an upgrade path so that users don't lose their previous defaults?

Yes, please. This is not a great upgrade experience. I am happy to help add a quirk to ubuntu-release-upgrader if needed (but it seems like some basic migration should be possible a postinst).

Changed in xdg-terminal-exec (Ubuntu):
status: Opinion → Confirmed
Revision history for this message
Alessandro Astone (aleasto) wrote :

I agree so I'll give this a shot.

It's not trivial because xdg-terminal-exec does a bit more than "here's a binary you should run", but perhaps we can make "most" cases work.

Changed in xdg-terminal-exec (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Alessandro Astone (aleasto)
milestone: none → plucky-updates
tags: added: udeng-6819
Revision history for this message
Jeremy Bícha (jbicha) wrote :

You could use a session-migration script in your implementation.

I feel like this could be complex to manage because xdg-terminal-exec uses the .desktop filename

Revision history for this message
Alessandro Astone (aleasto) wrote :

Mmh, I've run into an issue:

GNOME Terminal will set itself as the default xdg-terminal-exec program when started, if there's no default set. It does so by creating the ~/.config/GNOME-xdg-terminals.list, ~/.config/ubuntu-xdg-terminals.list and ~/.config/xdg-terminals.list files.

Because xdg-terminal-exec is not installed in e.g. noble, GNOME Terminal detects that there's no default set and so sets itself as default by writing the files mentioned above.

This means that in the migration script I cannot use the presence of ~/.config/*xdg-terminals.list as evidence that the user has already configured xdg-terminal-exec and avoid overwriting their preference...

Revision history for this message
Alessandro Astone (aleasto) wrote :

I guess one hack could be to check the timestamp of the config files and compare it to the creation timestamp of /usr/bin/xdg-terminal-exec. If the config file predates the binary, then it was bogus and I can discard it...

Revision history for this message
Alessandro Astone (aleasto) wrote :

Ah well, file creation timestamp is not well defined...

Revision history for this message
Jeremy Bícha (jbicha) wrote :

By default, GNOME Terminal sets those xdg-terminal-exec files regardless of whether xdg-terminal-exec is installed. It was fixed in plucky to be more careful about overwriting those files if they already exist.

Personally, I think the ideal fix before 26.04 LTS is to try to implement the gnome-control-center UI which should make it easy for people to change the default terminal to whatever they want.

The x-terminal-emulator approach had some weaknesses. For instance it wasn't used to open "terminal apps" where there is a .desktop that had set Terminal=true (glib defaults to using xdg-terminal-exec to run those if it is installed or a short list of other terminals otherwise and glib is unwilling to add to that list). The "terminal apps" may not be commonly used but there are some available.

Revision history for this message
Alessandro Astone (aleasto) wrote :
Changed in xdg-terminal-exec (Ubuntu):
status: Confirmed → In Progress
description: updated
Changed in xdg-terminal-exec (Ubuntu Plucky):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Alessandro Astone (aleasto)
milestone: none → plucky-updates
Changed in xdg-terminal-exec (Ubuntu):
milestone: plucky-updates → ubuntu-25.10
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-terminal-exec - 0.13.2-2ubuntu1

---------------
xdg-terminal-exec (0.13.2-2ubuntu1) questing; urgency=medium

  * Add migration script from x-terminal-emulator (LP: #2107326, #2121943)

 -- Alessandro Astone <email address hidden> Mon, 08 Sep 2025 10:46:46 +0200

Changed in xdg-terminal-exec (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Ubuntu 25.04 (Plucky Puffin) has reached end of life, so this bug will not be fixed for that specific release.

Changed in xdg-terminal-exec (Ubuntu Plucky):
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.