Allow passing the currently active kitty window id in the launch command
See #2391
This commit is contained in:
parent
82e5750d71
commit
a82e45ad71
@ -26,6 +26,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- X11: Fix arrow mouse cursor using right pointing instead of the default left
|
||||
pointing arrow (:iss:`2341`)
|
||||
|
||||
- Allow passing the currently active kitty window id in the launch command
|
||||
(:iss:`2391`)
|
||||
|
||||
- unicode input kitten: Allow pressing :kbd:`ctrl+tab` to change the input mode
|
||||
(:iss:`2343`)
|
||||
|
||||
|
||||
@ -50,6 +50,17 @@ being the top left corner and ``{lines},{columns}`` being the number of rows
|
||||
and columns of the screen.
|
||||
|
||||
|
||||
Special arguments
|
||||
-------------------
|
||||
|
||||
There are a few special placeholder arguments that can be specified as part of
|
||||
the command line. Namely ``@selection`` which is replaced by the current
|
||||
selection and ``@kitty_active_window_id`` which is replaced by the id of the
|
||||
currently active kitty window. For example::
|
||||
|
||||
map f1 launch my-program @kitty-active-window-id
|
||||
|
||||
|
||||
Syntax reference
|
||||
------------------
|
||||
|
||||
|
||||
@ -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:
|
||||
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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user