Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xdg-terminal-exec support #1570

Closed
ManuelSchneid3r opened this issue Jul 16, 2024 · 4 comments · Fixed by #1590
Closed

xdg-terminal-exec support #1570

ManuelSchneid3r opened this issue Jul 16, 2024 · 4 comments · Fixed by #1590

Comments

@ManuelSchneid3r
Copy link

Running a command in a terminal from another app is a common usecase. Almost all terminals provide such a command execution interface (-e, -x, -- or such). Clients can guess, but they cant know it for sure. If it can break, it will break.

There is a freedesktop spec proposal that tries to standardize the way we configure a default terminal for command execution. It implicitly solves the above problem. Its as simple as that: the app/package provides this info.

To support it you simply need to add X-ExecArgs or ExecArgs (the reference implementation respects both) to the desktop file (like this) and make sure there is TerminalEmulator in Categories. It has not yet been approved (therefore the X-) but hey ExecArgs does not conflict any standard key and if it will be approved you dont have to change it again.

As an elaborative example see how GNOME terminal does it: GNOME/gnome-terminal@f1814cb

This will help making Linux a better user experience and a less annoying developer experience.

Thank you

PS:
The draft states that the default will be -e and you might think "okay, done" if your ExecArg is -e. I recommend to add it anyway because then you are on the safe side if the final spec does not fall back to -e. I guess (hope) there will be no default.
You might also think "Why that early if it's a draft?". Correct, but if you do so, I will give you a grateful hug should we ever meet in real life because I am the maintainer of that frustrating list linked in the beginning. If you do so I can wipe your entry from the list ❤️. Also this proposal is a good thing and we should all push it.

@ManuelSchneid3r
Copy link
Author

Now that I know that there is a related intentapp draft and a terminal intent I'll have to get an opinion before starting discussions.

@ManuelSchneid3r
Copy link
Author

I though a while about it and also discussed it on the xdg mailing list and came to the conclusion that it makes sense to add it, even in the advent of the terminal intent.

@Yaraslaut
Copy link
Member

Hi @ManuelSchneid3r, thanks for your work and time in unification of usage across terminals, contour supports different options, and all following examples are valid

contour emacs
contour -e emacs
contour execute emacs

I will add

+ExecArgs=execute

to our desktop file

@Yaraslaut
Copy link
Member

@ManuelSchneid3r I discovered in our AppImage github action the following :

2024-09-04T19:16:08.1767606Z [appimage/stdout] /home/runner/work/contour/contour/AppDir/org.contourterminal.Contour.desktop: error: file contains key "ExecArgs" in group "Desktop Entry", but keys extending the format should start with "X-"
2024-09-04T19:16:08.1769783Z [appimage/stderr] ERROR: Desktop file contains errors. Please fix them. Please see
2024-09-04T19:16:08.1771866Z [appimage/stderr]        https://standards.freedesktop.org/desktop-entry-spec/1.0/n       for more information.

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 a pull request may close this issue.

2 participants