The result is as expected in all cases. Note the extra "/usr/bin/xdg-settings: 734: [: x!: unexpected operator" on stderr in the last test. This is not expected, but it is harmless as the output on stdout is as expected. I will report a follow-up upstream bug to get that addressed.
Successfully tested by doing the following:
In a fully up-to-date jammy VM:
$ sudo apt -y install libkf5config-bin DESKTOP= KDE VERSION= 5 bin/xdg- settings: 734: Bad substitution
$ export XDG_CURRENT_
$ export KDE_SESSION_
$ xdg-settings get default-web-browser
firefox.desktop
$ xdg-settings check default-web-browser firefox.desktop
/usr/
Then enabled the jammy-proposed pocket and updated xdg-utils to version 1.1.3-4. 1ubuntu1. 22.04.1:
$ xdg-settings get default-web-browser bin/xdg- settings: 734: [: x!: unexpected operator
firefox.desktop
$ xdg-settings check default-web-browser foobar.desktop
no
$ xdg-settings check default-web-browser firefox.desktop
/usr/
yes
The result is as expected in all cases. Note the extra "/usr/bin/ xdg-settings: 734: [: x!: unexpected operator" on stderr in the last test. This is not expected, but it is harmless as the output on stdout is as expected. I will report a follow-up upstream bug to get that addressed.