Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: close_other_windows command #2484

Closed
matklad opened this issue Mar 26, 2020 · 1 comment
Closed

Feature suggestion: close_other_windows command #2484

matklad opened this issue Mar 26, 2020 · 1 comment

Comments

@matklad
Copy link

matklad commented Mar 26, 2020

Hi!

Often times, after doing several splits, I need to all kitty windows except the current focused one. An close_other_windows command would be useful for this. I'll try to write a kitten for myself, but having it built-in would be nice!

@matklad
Copy link
Author

matklad commented Mar 26, 2020

Wow, thanks for the quick fix! For posterity, here's the kitten I've came up with

def main(args):
   pass

def handle_result(args, answer, target_window_id, boss):
    active_window = boss.active_window
    if not active_window:
        return
    for window in boss.all_windows:
        if window != active_window:
            window.close()

handle_result.no_ui = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant