Skip to content

Commit

Permalink
pop_keyboard_mode should return True when nothing is done
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 3, 2023
1 parent cc5424c commit ca6c607
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kitty/boss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,12 +1340,13 @@ def active_window(self) -> Optional[Window]:
End the current keyboard mode switching to the previous mode.
''')
def pop_keyboard_mode(self) -> bool:
passthrough = True
if self.keyboard_mode_stack:
self.keyboard_mode_stack.pop()
if not self.keyboard_mode_stack:
set_ignore_os_keyboard_processing(False)
return True
return False
passthrough = False
return passthrough

@ac('misc', '''
Switch to the specified keyboard mode, pushing it onto the stack of keyboard modes.
Expand All @@ -1368,7 +1369,7 @@ def dispatch_possible_special_key(self, ev: KeyEvent) -> bool:
return False
if self.global_shortcuts_map and get_shortcut(self.global_shortcuts_map, ev):
return True
if self.pop_keyboard_mode():
if not self.pop_keyboard_mode():
if get_options().enable_audio_bell:
ring_bell()
return True
Expand Down

0 comments on commit ca6c607

Please sign in to comment.