dnkl/foot
41
2.0k
Fork
You've already forked foot
243

Add --class synonym to --app-id #2368

Closed
opened 2026年05月25日 00:47:02 +02:00 by raymondila · 8 comments

Describe your feature request

The request

Consider adding --class synonym to --app-id argument.

The issue

Some distros let you change terminal and they use something like $TERMINAL --class=window.mini to launch the term minimized. Kitty, alacritty use --class cmd argument, but foot doesn't support it.

Just adding --class that equals to --app-id would solve that problem, despite that it's x11 thing related.

### Describe your feature request ## The request Consider adding --class synonym to --app-id argument. ## The issue Some distros let you change terminal and they use something like $TERMINAL --class=window.mini to launch the term minimized. Kitty, alacritty use --class cmd argument, but foot doesn't support it. Just adding --class that equals to --app-id would solve that problem, despite that it's x11 thing related.
raymondila stopped working 2026年05月25日 01:28:35 +02:00
9 seconds
raymondila deleted spent time 2026年05月25日 01:28:40 +02:00
- 9 seconds
Collaborator
Copy link

Some distros let you change terminal and they use something like $TERMINAL --class=window.mini

Which ones?

Just adding --class that equals to --app-id would solve that problem

I'd suggest writing a wrapper script and setting that as $TERMINAL, and perhaps also reporting their unconditional use of $TERMINAL --class=window.mini as a bug. It just sounds like a re-run of some other scripts assuming every terminal supports -e. At some point terminals just have to say "please stop writing shoddy scripts" instead of "ok we'll add another pointless option".

> Some distros let you change terminal and they use something like $TERMINAL --class=window.mini Which ones? > Just adding --class that equals to --app-id would solve that problem I'd suggest writing a wrapper script and setting that as `$TERMINAL`, and perhaps also reporting their unconditional use of `$TERMINAL --class=window.mini` as a bug. It just sounds like a re-run of some other scripts assuming every terminal supports `-e`. At some point terminals just have to say "please stop writing shoddy scripts" instead of "ok we'll add another pointless option".

The problem is not only about putting terminal-specific arguments into $TERMINAL.

The use case is launching a small/mini terminal window in a terminal-agnostic way. Majority of terminals support this with --class, but for foot this is --app-id. So if a user selects foot as their terminal, scripts that expect class-based matching for a mini terminal cannot work correctly.

Making a wrapper isn't a valid case because TERMINAL var is usually xdg-terminal-exec to make some terminal default. To solve the problem, all the xdg-terminal-exec must be changed to some wrapper script.

Yes, it is possible to solve the problem but it looks to complicated just to support foot as another options between a lot of other terminal emulators.

The problem is not only about putting terminal-specific arguments into $TERMINAL. The use case is launching a small/mini terminal window in a terminal-agnostic way. Majority of terminals support this with --class, but for foot this is --app-id. So if a user selects foot as their terminal, scripts that expect class-based matching for a mini terminal cannot work correctly. Making a wrapper isn't a valid case because TERMINAL var is usually xdg-terminal-exec to make some terminal default. To solve the problem, all the xdg-terminal-exec must be changed to some wrapper script. Yes, it is possible to solve the problem but it looks to complicated just to support foot as another options between a lot of other terminal emulators.

@craigbarnes wrote in #2368 (comment):

Just adding --class that equals to --app-id would solve that problem

I'd suggest writing a wrapper script and setting that as $TERMINAL, and perhaps also reporting their unconditional use of $TERMINAL --class=window.mini as a bug. It just sounds like a re-run of some other scripts assuming every terminal supports -e. At some point terminals just have to say "please stop writing shoddy scripts" instead of "ok we'll add another pointless option".

Your solution is not really workable, as now you'll have to have a wrapper to handle each terminal's quirks. Not only is it an additional unnecessary layer, but it will break the moment some new shiny terminal comes out with its own set of options.

FWIW here is a list of top 10 terminals (biased of course):

Alacritty – Supports --class
Foot
Ghostty – Supports --class
GNOME Terminal – Supports --class
Hyper
iTerm2
Kitty – Supports --class
Konsole
Warp
WezTerm – Supports --class (via wezterm start --class)

As you can see half of them already support the --class option. And, considering that the effort to add it is minimal, IMHO it would be worth it.

@craigbarnes wrote in https://codeberg.org/dnkl/foot/issues/2368#issuecomment-15833192: > > Just adding --class that equals to --app-id would solve that problem > > I'd suggest writing a wrapper script and setting that as `$TERMINAL`, and perhaps also reporting their unconditional use of `$TERMINAL --class=window.mini` as a bug. It just sounds like a re-run of some other scripts assuming every terminal supports `-e`. At some point terminals just have to say "please stop writing shoddy scripts" instead of "ok we'll add another pointless option". Your solution is not really workable, as now you'll have to have a wrapper to handle each terminal's quirks. Not only is it an additional unnecessary layer, but it will break the moment some new shiny terminal comes out with its own set of options. FWIW here is a list of top 10 terminals (biased of course): Alacritty – Supports --class Foot Ghostty – Supports --class GNOME Terminal – Supports --class Hyper iTerm2 Kitty – Supports --class Konsole Warp WezTerm – Supports --class (via wezterm start --class) As you can see half of them already support the --class option. And, considering that the effort to add it is minimal, IMHO it would be worth it.

If the devs are on-board with this, I can submit a PR.

If the devs are on-board with this, I can submit a PR.
Collaborator
Copy link

Some distros let you change terminal and they use something like $TERMINAL --class=window.mini to launch the term minimized.

Can we have a specific example of this? A link would be ideal.

> Some distros let you change terminal and they use something like `$TERMINAL --class=window.mini` to launch the term minimized. Can we have a specific example of this? A link would be ideal.

@craigbarnes wrote in #2368 (comment):

Some distros let you change terminal and they use something like $TERMINAL --class=window.mini to launch the term minimized.

Can we have a specific example of this? A link would be ideal.

I will let the OP talk about his case, but on Debian and all of its derivatives there is a virtual package called x-terminal-emulator which is provided by all the various terminal applications:

$ apt-cache showpkg x-terminal-emulator | awk '/Reverse P/{f=1;next} f{print 1ドル}' | sort -u | column | expand
alacritty lxterminal terminator
blackbox-terminal mate-terminal terminology
cool-retro-term mlterm termit
deepin-terminal mlterm-tiny tilix
eterm pterm xfce4-terminal
foot ptyxis xiterm+thai
gnome-console qmlkonsole xterm
gnome-terminal qterminal yakuake
kitty rxvt-unicode zutty
konsole sakura
lomiri-terminal-app stterm

This allows other packages to declare dependency on x-terminal-emulator, if they don't care which one the user has installed as long as there is one:

$ apt-cache showpkg x-terminal-emulator | awk -F, '/Reverse D/{f=1;next} /Dependencies:/{f=0} f{print 1ドル}' | sort -u | column | expand
 afterstep nm-tray
 apt-listchanges notion
 budgie-desktop-environment odin
 cinnamon-core oidc-agent-desktop
 codelite pconsole
 deb-gview phalanx
 debian-installer-launcher qtcreator
 doublecmd-common ratpoison
 draai secpanel
 dwm seyon
 enlightenment spectrwm
 exmh squeak-vm
 firetools steam-libs
 fvwm-crystal stumpwm
 gdm3 surf
 gkdebconf tkabber-plugins
 gnome-panel tk-brief
 gnuradio tkrev
 grass-gui user-mode-linux
 i3-wm winff-qt
 ivtools-bin wm2
 jwm wmaker
 labwc wmbubble
 libfile-desktopentry-perl xboard
 links2 xdg-terminal-exec
 luakit xinit
 lwm xorg
 lxde-core xpaint
 lxpanel xttitle
 mdk xvkbd
 miwm xxdiff
 netwag

Similar things exist for editors, browsers, compilers, awk providers, etc.

Along with that, there is the Debian Alternatives system, which provides symlinks for default applications. For example:

$ update-alternatives --config c++
There are 2 choices for the alternative c++ (providing /usr/bin/c++).
 Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/g++ 20 auto mode
 1 /usr/bin/clang++ 10 manual mode
 2 /usr/bin/g++ 20 manual mode
Press <enter> to keep the current choice[*], or type selection number:

or

$ update-alternatives --config x-terminal-emulator 
There are 3 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).
 Selection Path Priority Status
------------------------------------------------------------
 0 /usr/bin/foot 20 auto mode
 1 /usr/bin/alacritty 20 manual mode
* 2 /usr/bin/foot 20 manual mode
 3 /usr/bin/footclient 10 manual mode
Press <enter> to keep the current choice[*], or type selection number:

So, any program/script can just call editor /path/to/foo or x-terminal-emulator btop and doesn't have to worry about the details.

Consequently, if these alternative providers have the same set of basic options, it makes life a lot easier for downstream devs and users.

@craigbarnes wrote in https://codeberg.org/dnkl/foot/issues/2368#issuecomment-16628813: > > Some distros let you change terminal and they use something like `$TERMINAL --class=window.mini` to launch the term minimized. > > Can we have a specific example of this? A link would be ideal. I will let the OP talk about his case, but on Debian and all of its derivatives there is a virtual package called [x-terminal-emulator](https://packages.debian.org/sid/x-terminal-emulator) which is provided by all the various terminal applications: ```console $ apt-cache showpkg x-terminal-emulator | awk '/Reverse P/{f=1;next} f{print 1ドル}' | sort -u | column | expand alacritty lxterminal terminator blackbox-terminal mate-terminal terminology cool-retro-term mlterm termit deepin-terminal mlterm-tiny tilix eterm pterm xfce4-terminal foot ptyxis xiterm+thai gnome-console qmlkonsole xterm gnome-terminal qterminal yakuake kitty rxvt-unicode zutty konsole sakura lomiri-terminal-app stterm ``` This allows other packages to declare dependency on x-terminal-emulator, if they don't care which one the user has installed as long as there is one: ```console $ apt-cache showpkg x-terminal-emulator | awk -F, '/Reverse D/{f=1;next} /Dependencies:/{f=0} f{print 1ドル}' | sort -u | column | expand afterstep nm-tray apt-listchanges notion budgie-desktop-environment odin cinnamon-core oidc-agent-desktop codelite pconsole deb-gview phalanx debian-installer-launcher qtcreator doublecmd-common ratpoison draai secpanel dwm seyon enlightenment spectrwm exmh squeak-vm firetools steam-libs fvwm-crystal stumpwm gdm3 surf gkdebconf tkabber-plugins gnome-panel tk-brief gnuradio tkrev grass-gui user-mode-linux i3-wm winff-qt ivtools-bin wm2 jwm wmaker labwc wmbubble libfile-desktopentry-perl xboard links2 xdg-terminal-exec luakit xinit lwm xorg lxde-core xpaint lxpanel xttitle mdk xvkbd miwm xxdiff netwag ``` Similar things exist for editors, browsers, compilers, awk providers, etc. Along with that, there is the [Debian Alternatives](https://wiki.debian.org/DebianAlternatives) system, which provides symlinks for default applications. For example: ```console $ update-alternatives --config c++ There are 2 choices for the alternative c++ (providing /usr/bin/c++). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/g++ 20 auto mode 1 /usr/bin/clang++ 10 manual mode 2 /usr/bin/g++ 20 manual mode Press <enter> to keep the current choice[*], or type selection number: ``` or ```console $ update-alternatives --config x-terminal-emulator There are 3 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/bin/foot 20 auto mode 1 /usr/bin/alacritty 20 manual mode * 2 /usr/bin/foot 20 manual mode 3 /usr/bin/footclient 10 manual mode Press <enter> to keep the current choice[*], or type selection number: ``` So, any program/script can just call `editor /path/to/foo` or `x-terminal-emulator btop` and doesn't have to worry about the details. Consequently, if these alternative providers have the same set of basic options, it makes life a lot easier for downstream devs and users.

This options actually solves the problem of making a lot of wrappers for other wrappers. With this it's just possible to write $term --class and no need to write a lot of scripts.

This options actually solves the problem of making a lot of wrappers for other wrappers. With this it's just possible to write $term --class and no need to write a lot of scripts.
Owner
Copy link

I'm generally against these kind of things, but I can see how this can be useful.

How about #2392? The new --class alias is intentionally minimally documented. Hope that's ok.

I'm generally against these kind of things, but I can see how this can be useful. How about https://codeberg.org/dnkl/foot/pulls/2392? The new `--class` alias is intentionally minimally documented. Hope that's ok.
Sign in to join this conversation.
No Branch/Tag specified
master
osc-5522
sixel-heap-buffer-overflow
releases/1.27
releases/1.26
releases/1.25
releases/1.24
multi-cursor
releases/1.23
pixman-16f-2
releases/1.22
releases/1.21
releases/1.20
releases/1.19
releases/1.18
releases/1.17
releases/1.16
releases/1.15
releases/1.14
releases/1.13
releases/1.12
releases/1.11
releases/1.10
releases/1.9
releases/1.8
releases/1.7
releases/1.6
releases/1.5
releases/1.4
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.27.0
1.26.1
1.26.0
1.25.0
1.24.0
1.23.1
1.23.0
1.22.3
1.22.2
1.22.1
1.22.0
1.21.0
1.20.2
1.20.1
1.20.0
1.19.0
1.18.1
1.18.0
1.17.2
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.15.3
1.15.2
1.15.1
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11.0
1.10.3
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.2
1.7.1
1.7.0
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
0.9.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot#2368
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?