Some missing context here is the original bug report from martin f krafft:

Unfortunately, Kitty does not accept the `-name` command-line option, and instead spews and error message. This is a problem when it is used as a drop-in to `x-terminal-emulator`, which sometimes gets passed the `-name` option (supported by every other terminal emulator that I know).

If the maintainers of kitty don't want to add a -name option, then I think this should be closed as "won't fix". Policy is clear about the requirements for a terminal to be available via the x-terminal-emulator alternative:

    To be an x-terminal-emulator, a program must:
    - Be able to emulate a DEC VT100 terminal, or a compatible terminal.
    - Support the command-line option -e *command* [...]
    - Support the command-line option -T *title* [...]

Notably, the -name option does not appear anywhere on that list.

So if some other piece of software is making the assumption that every x-terminal-emulator supports an xterm-compatible "-name" option, then that's a bug in the other piece of software, not a bug in kitty. The same is true for "-title" (the x-terminal-emulator specification only requires the short form -T to be supported).

*Some* x-terminal-emulator implementations, like xterm and the Debian-specific gnome-terminal.wrapper, additionally support options like "-name" and "-title", but there is no guarantee about those.

ptyxis and GNOME Console (kgx) don't support "-name" either.

It would be possible to have a wrapper script that parses a subset of xterm command-line syntax and translates it to kitty syntax (/usr/bin/gnome-terminal.wrapper in the gnome-terminal package, which does the same thing for gnome-terminal, would be a good starting point), but I think it's entirely reasonable for the Debian maintainers of kitty not to want to be responsible for maintaining such a thing.

On Wed, 23 Apr 2025 at 20:19:09 +0530, Nilesh Patra wrote:
On 23 April 2025 7:36:44 pm IST, martin f krafft <madd...@debian.org> wrote:
Regarding the following, written by "Nilesh Patra" on 2025-04-22 at 17:59 Uhr 
+0530:
As per upstream we need to use "xdg-terminal-exec". However, I could not find 
an alternative system by that name yet in Debian.

The xdg-terminal-exec protocol does not involve /etc/alternatives, but anyway it also doesn't (guarantee to) support a "-name" option. (It also doesn't support either "-title" or "-T".)

xdg-terminal-exec is a proposed specification for launching a command in "any suitable terminal emulator", in a terminal-agnostic way, vaguely similar to x-terminal-emulator. The reference implementation of this protocol is available in the xdg-terminal-exec package in trixie, and the protocol itself is described in /usr/share/doc/xdg-terminal-exec/README.md.gz in that package.

`x-terminal-emulator` and the alternatives system is a bit antiquated

Specifically, the main advantage of xdg-terminal-exec over x-terminal-emulator, other than it not being Debian-specific, is that that by default it will try to choose an appropriate terminal emulator for the desktop environment. For example, suppose GNOME user Greta and KDE Plasma user Kevin share a computer, they both use mutt as their email client and mailto: handler, and neither of them has reconfigured their preferred terminal.

With those prerequisites, when both users click on mailto: links, Greta would reasonably expect to see mutt open in gnome-terminal or similar, while Kevin would expect Konsole or similar. xdg-terminal-exec can do this. x-terminal-emulator cannot: there is only one /etc/alternatives/x-terminal-emulator, system-wide, which cannot simultaneously point to /usr/bin/gnome-terminal.wrapper and to /usr/bin/konsole, so at least one of our two users will be disappointed.

(xdg-terminal-exec is also configurable per-user via files in ~/.config, whereas the closest thing we have to being able to configure x-terminal-emulator per-user is for each user to figure out how to alter their $PATH to include ~/bin or ~/.local/bin or similar, and then put a x-terminal-emulator symlink in that directory pointing to their preferred implementation.)

    smcv

Reply via email to