Implement --detach for panel kitten

This commit is contained in:
Kovid Goyal 2025-04-24 06:30:33 +05:30
parent 7a31dad770
commit 0c3797ec90
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 9 additions and 1 deletions

View file

@ -80,7 +80,7 @@ disappears at a key press. To do so use the following command::
kitty +kitten panel --edge=top --layer=overlay --lines=15 \
--focus-policy=exclusive --exclusive-zone=0 --override-exclusive-zone \
-o background_opacity=0.8 --toggle-visibility --single-instance \
--instance-group=quake
--instance-group=quake --detach
Run this command in a terminal, and a quick access kitty panel will show up at
the top of your screen. Run it again, and the panel will be hidden.

View file

@ -183,6 +183,11 @@ type=bool-set
Start in hidden mode, useful with :option:`--toggle-visibility`.
--detach
type=bool-set
Detach from the controlling terminal, if any.
--debug-rendering
type=bool-set
For internal debugging use.
@ -338,6 +343,9 @@ def handle_single_instance_command(boss: BossType, sys_args: Sequence[str], envi
def main(sys_args: list[str]) -> None:
global args
args, items = parse_panel_args(sys_args[1:])
if args.detach:
from kitty.utils import detach
detach()
sys.argv = ['kitty']
if args.debug_rendering:
sys.argv.append('--debug-rendering')