From 3bf9130b0a514d8ff74317a4978aa953adf06501 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 14 May 2021 07:25:48 +0530 Subject: [PATCH] Fix deleting windows that are not the last window via remote control leaving no window focused Fixes #3619 --- docs/changelog.rst | 3 +++ kitty/window_list.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 79d411f4d..435db73a9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -50,6 +50,9 @@ To update |kitty|, :doc:`follow the instructions `. - Fix passing STDIN to launched background processes causing them to not inherit environment variables (:pull:`3603`) +- Fix deleting windows that are not the last window via remote control leaving + no window focused (:iss:`3619`) + 0.20.3 [2021-05-06] ---------------------- diff --git a/kitty/window_list.py b/kitty/window_list.py index 79e025187..a2a2a33cb 100644 --- a/kitty/window_list.py +++ b/kitty/window_list.py @@ -330,6 +330,8 @@ class WindowList: if self.groups: if self.active_group_idx == i: self.make_previous_group_active(notify=False) + elif self.active_group_idx >= len(self.groups): + self._active_group_idx -= 1 else: self._active_group_idx = -1 break