main/client: add --class, an alias for --app-id

This is to help e.g. scripts that wants to launch terminal instances
in a terminal agnostic way.

Many terminals were originally for X11, where the '--class' choice was
obvious. When they were ported to Wayland, it made sense for them to
keep the '--class' command line option, but have it set the
application ID instead (since "class" is not a thing on Wayland).

Let's add the alias, but minimally documented. We don't want to
_encourage_ its use after all.

Closes #2368
This commit is contained in:
Daniel Eklöf 2026-06-20 18:13:13 +02:00
parent 43d2d97386
commit 73e6d21000
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 16 additions and 0 deletions

View file

@ -72,6 +72,14 @@
## Unreleased
### Added
* Command line option `--class`, an alias for `--app-id`. Intended to
be used by scripts and similar that wants to launch terminal
instances in a terminal agnostic way ([#2368][2368]).
[2368]: https://codeberg.org/dnkl/foot/issues/2368
### Changed
* Do not allow codepoints to be merged into grapheme clusters directly

View file

@ -157,6 +157,7 @@ main(int argc, char *const *argv)
{"term", required_argument, NULL, 't'},
{"title", required_argument, NULL, 'T'},
{"app-id", required_argument, NULL, 'a'},
{"class", required_argument, NULL, 'a'},
{"toplevel-tag", required_argument, NULL, TOPLEVEL_TAG_OPTION},
{"window-size-pixels", required_argument, NULL, 'w'},
{"window-size-chars", required_argument, NULL, 'W'},

View file

@ -70,6 +70,9 @@ the foot command line
Value to set the *app-id* property on the Wayland window
to. Default: _foot_ (normal mode), or _footclient_ (server mode).
*--class*=_ID_
Alias for *--app-id*.
*toplevel-tag*=_TAG_
Value to set the *toplevel-tag* property on the Wayland window
to. The compositor can use this value for session management,

View file

@ -33,6 +33,9 @@ terminal has terminated.
Value to set the *app-id* property on the Wayland window
to. Default: _foot_ (normal mode), or _footclient_ (server mode).
*--class*=_ID_
Alias for *--app-id*.
*toplevel-tag*=_TAG_
Value to set the *toplevel-tag* property on the Wayland window
to. The compositor can use this value for session management,

1
main.c
View file

@ -216,6 +216,7 @@ main(int argc, char *const *argv)
{"term", required_argument, NULL, 't'},
{"title", required_argument, NULL, 'T'},
{"app-id", required_argument, NULL, 'a'},
{"class", required_argument, NULL, 'a'},
{"toplevel-tag", required_argument, NULL, TOPLEVEL_TAG_OPTION},
{"login-shell", no_argument, NULL, 'L'},
{"working-directory", required_argument, NULL, 'D'},