From 07127c1d1bf8b39f98a304a0d706f84ff8c348aa Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Mon, 5 May 2025 09:14:00 +0100 Subject: [PATCH] feat: add support for scrolling up with Shift+Space in different terminals --- git_time_machine.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git_time_machine.py b/git_time_machine.py index 7a44ed1..f36e7fb 100644 --- a/git_time_machine.py +++ b/git_time_machine.py @@ -151,7 +151,9 @@ def main(stdscr, filename): scroll_offset -= 1 elif key in [curses.KEY_NPAGE, ord(' ')]: scroll_offset = min(scroll_offset + height - 1, max_scroll) - elif key in [curses.KEY_PPAGE, 8, 127]: # Page Up or Shift+Space (some terminals) + elif key in [curses.KEY_PPAGE, 8, 127, curses.KEY_SR]: # Page Up, Backspace, Delete, or Shift+Up + scroll_offset = max(0, scroll_offset - (height - 1)) + elif key == curses.KEY_BACKSPACE: # Another way to detect Shift+Space in some terminals scroll_offset = max(0, scroll_offset - (height - 1)) # Pane switching