2

On Fedora 39, kitty 0.31.0 shows a desktop notification for every command that completes:

enter image description here

Is it possible to disable this?

1 Answers1

1

I went down the rabbit hole trying to figure this out. Looks like the vte-profile fedora package adds a /etc/profile.d/vte.sh script that is automatically sourced for bash (and zsh) and is responsible for this behavior. It works by defining functions that get added to the PROMPT_COMMAND bash array to figure out which command was executed (using history) and then trigger a notification when the command prompt is rendered after command execution.

A quick and dirty way of getting rid of the notifications only is to redefine the __vte_shell_precmd() function (which displays the actual notification) to an empty function. e.g.

__vte_shell_precmd() {
  :
}

You could also just unset PROMPT_COMMAND but that could also affect the shell prompt and the terminal's ability to know the current directory (OSC 7).

Ultimately, none of this should be running at all since I don't think kitty is based on vte. The only reason it is being executed is that the script checks for vte by checking the VTE_VERSION environment variable. If I start kitty using the Gnome UI it does not exhibit this behavior because VTE_VERSION is unset. If I start it up from a vte-based terminal, the terminal exports the VTE_VERSION environment variable and, if I run kitty from that command line, I will get VTE_VERSION defined in the kitty process and its bash shell. So if you are starting kitty from another vte-based terminal, you can start it like this to avoid the issue.

VTE_VERSION= kitty

This will unset VTE_VERSION for the kitty process avoiding the whole issue.

Aner
  • 291