@@ -450,13 +450,11 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr
450
450
log .debug ("Launching a new terminal: %r" % argv )
451
451
452
452
stdin = stdout = stderr = open (os .devnull , 'r+b' )
453
- if terminal == 'tmux' or terminal == 'kitty' :
453
+ if terminal == 'tmux' or terminal in ( 'kitty' , 'kitten' ) :
454
454
stdout = subprocess .PIPE
455
455
456
456
p = subprocess .Popen (argv , stdin = stdin , stdout = stdout , stderr = stderr , preexec_fn = preexec_fn )
457
457
458
- kittyid = None
459
-
460
458
if terminal == 'tmux' :
461
459
out , _ = p .communicate ()
462
460
try :
@@ -469,7 +467,7 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr
469
467
with subprocess .Popen ((qdbus , konsole_dbus_service , '/Sessions/{}' .format (last_konsole_session ),
470
468
'org.kde.konsole.Session.processId' ), stdout = subprocess .PIPE ) as proc :
471
469
pid = int (proc .communicate ()[0 ].decode ())
472
- elif terminal == 'kitty' :
470
+ elif terminal in ( 'kitty' , 'kitten' ) :
473
471
pid = p .pid
474
472
475
473
out , _ = p .communicate ()
@@ -503,7 +501,7 @@ def kill():
503
501
try :
504
502
if terminal == 'qdbus' :
505
503
os .kill (pid , signal .SIGHUP )
506
- elif terminal == 'kitty' :
504
+ elif terminal in ( 'kitty' , 'kitten' ) :
507
505
subprocess .Popen (["kitten" , "@" , "close-window" , "--match" , "id:{}" .format (kittyid )], stderr = stderr )
508
506
else :
509
507
os .kill (pid , signal .SIGTERM )
0 commit comments