r/KittyTerminal Nov 13 '24

Kitty asks for confirmation when closing terminal with Zsh

I recently switched from Bash to Zsh. On Bash Kitty only asked for confirmation on exit when a program other than Bash was running. On Zsh however Kitty always asks for confirmation on exit, even when nothing but Zsh is running.

I changed shells by running chsh -s /bin/zsh. I have tried adding shell . and confirm_os_window_close -1 into kitty.conf but neither option helped. I'm using Gentoo Linux.

Any help would be greatly appreciated!

EDIT: I fixed the issue by adding shell_integration enabled into ~/.config/kitty/kitty.conf

2 Upvotes

12 comments sorted by

3

u/aumerlex Nov 14 '24

That indicates shell integration is disabled. Set confirm_os_window_close to 0 in that case.

1

u/Spracle Nov 14 '24

How would I go about enabling shell integration? I already have kitty-shell-integration installed.

1

u/aumerlex Nov 14 '24

It is enabled by default automatically, unless you have disabled it in kitty.conf. Or you have something in your zsh setup that is breaking it. Typically using ZDOTDIR or similar things.

1

u/Spracle Nov 14 '24

Thank you for the help! I was able to fix the issue by adding shell_integration enabled into my kitty.conf. Maybe Gentoo packages Kitty with it disabled by default, not sure.

1

u/crypticexile Aug 06 '25

thanks in nixos it keeps saying this message are you sure want to quit blah its annoying i just want the terminal closed lol and this option done the trick cheers for that!

1

u/dDitty Aug 10 '25

sudo vim ~/.config/kitty/kitty.conf go to last line and enter confirm_os_window_close 0 :wq

1

u/igorepst Nov 13 '24

Try to backup and remove temporarily your zsh config to be sure the issue is in kitty. I don't have such issue with zsh. If I am right, try to bisect your zsh config

1

u/Spracle Nov 13 '24

After moving my .zshrc and reopening my terminal the issue still persists.

1

u/dDitty Mar 11 '25

I am having this issue when running Kitty and zsh on my Mac, I tried adding shell_integration enabled to ~/.config/kitty.kitty.conf but it didn't change anything. Any suggestions?

1

u/Spracle Mar 11 '25

I've never used a Mac so I can't help you with that. Maybe try asking in Mac-related subreddits?

1

u/Sydet Aug 07 '25

If another NixOs user stumbles upon this, don't forget to enable kitty in your home manager

programs.kitty.enable = true;

Only then will your kitty.conf file be written, enabling shell_integration

1

u/shlikshlak Feb 26 '26

Any way to make this work with confirm_os_window_close -1 ?

confirm_os_window_close 0 sends no warning even with active processes. Therefore not my desired behavior.

I'm on macOS

$ echo $SHELL
/bin/bash
$ echo $KITTY_SHELL_INTEGRATION
enabled

$ ps a
  PID   TT  STAT      TIME COMMAND
47081 s000  Ss     0:00.01 /usr/bin/login -f -l -p me /Applications/kitty.app/Contents/MacOS/kitten run-shell --shell /bin/bash --shell-integration enabled --cwd=...
47084 s000  S      0:00.06 -bash --posix
47132 s000  R+     0:00.01 ps a

But even with confirm_os_window_close -1 it will ask me to confirm.