diff --git a/kitty/boss.py b/kitty/boss.py index a951e86b7..dbfbebc64 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -122,6 +122,8 @@ class Boss(Thread): passthrough = func() if not passthrough: return + if self.char_grid.scrolled_by: + self.scroll_end() data = interpret_key_event(key, scancode, mods) if data: self.write_to_child(data) @@ -292,4 +294,10 @@ class Boss(Thread): def scroll_page_down(self): self.queue_action(self.char_grid.scroll, 'page', False) + + def scroll_home(self): + self.queue_action(self.char_grid.scroll, 'full', True) + + def scroll_end(self): + self.queue_action(self.char_grid.scroll, 'full', False) # }}} diff --git a/kitty/char_grid.py b/kitty/char_grid.py index c9fb6d48e..a91cf3b66 100644 --- a/kitty/char_grid.py +++ b/kitty/char_grid.py @@ -219,7 +219,7 @@ class CharGrid: self.clear_count = 4 def scroll(self, amt, upwards=True): - amt = 1 if amt == 'line' else self.screen.lines - 1 if amt == 'page' else max(0, min(int(amt), self.screen.lines - 1)) + amt = {'line': 1, 'page': self.screen.lines - 1, 'full': self.screen.historybuf.count}[amt] if not upwards: amt *= -1 y = max(0, min(self.scrolled_by + amt, self.screen.historybuf.count)) diff --git a/kitty/config.py b/kitty/config.py index 384c7b5ad..12531eb0e 100644 --- a/kitty/config.py +++ b/kitty/config.py @@ -341,7 +341,9 @@ map ctrl+shift+c copy_to_clipboard map ctrl+shift+up scroll_line_up map ctrl+shift+down scroll_line_down map ctrl+shift+page_up scroll_page_up -map Ctrl+Shift+page_down scroll_page_down +map ctrl+shift+page_down scroll_page_down +map ctrl+shift+home scroll_home +map ctrl+shift+end scroll_end '''