Allow passing the currently active kitty window id in the launch command

See #2391
This commit is contained in:
Kovid Goyal
2020-02-23 19:17:26 +05:30
parent 82e5750d71
commit a82e45ad71
3 changed files with 21 additions and 4 deletions

View File

@@ -193,10 +193,13 @@ def launch(boss, opts, args, target_tab=None):
if cmd:
final_cmd = []
for x in cmd:
if x == '@selection' and active and not opts.copy_cmdline:
s = boss.data_for_at(active, x)
if s:
x = s
if active and not opts.copy_cmdline:
if x == '@selection':
s = boss.data_for_at(active, x)
if s:
x = s
elif x == '@active-kitty-window-id':
x = str(active.id)
final_cmd.append(x)
kw['cmd'] = final_cmd
if opts.type == 'overlay' and active and not active.overlay_window_id: