Skip to content

Allow @ launch to match against last created window #5753

@salmankhilji

Description

@salmankhilji

Consider this script, which creates a new tab and then two additional windows within the new tab:

id=$(kitty @ launch --keep-focus --type=tab --location=after)
id=$(kitty @ launch --match=id:$id)
id=$(kitty @ launch --match=id:$id)
kitty @ resize-window --increment=-8 --axis=vertical --match=id:$id

While this works, it would be nice if I did not have to create a temp variable, id, to remember the last created window.

Describe the solution you'd like

Say we introduce a new sentinel value, last, that matches the the last created window, which might not necessarily be in the active tab, then the above script would look like:

kitty @ launch --keep-focus --type=tab --location=after
kitty @ launch --match=id:last
kitty @ launch --match=id:last
kitty @ resize-window --increment=-8 --axis=vertical --match=id:last

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions