aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-26 10:43:28 -0400
committerCraig Jennings <c@cjennings.net>2026-06-26 10:43:28 -0400
commited8f4781d953fca0052765518a17cca15f2167ab (patch)
tree947feed46d422349c036ec88ec12504ef0ed693a /modules
parent7c7104ea5b22bf31d6c087b46f80ce2a6e215638 (diff)
downloaddotemacs-ed8f4781d953fca0052765518a17cca15f2167ab.tar.gz
dotemacs-ed8f4781d953fca0052765518a17cca15f2167ab.zip
feat(eat): tame the viewport bounce from full-frame inline redraws
Claude Code (and any Ink-style inline TUI) moves the terminal cursor up to redraw its whole block and back to the bottom on every tick; EAT follows the cursor with point, so the Emacs window chases it up and down -- the bounce. Add cj/--eat-tame-scroll on eat-mode-hook: scroll-conservatively 101, scroll-margin 0, and auto-window-vscroll nil, so the window line-scrolls minimally instead of recentering. It doesn't remove the bounce (the inline redraw is the root) but makes each jump gentler.
Diffstat (limited to 'modules')
-rw-r--r--modules/eat-config.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/eat-config.el b/modules/eat-config.el
index 425bbb5ed..317f6a63f 100644
--- a/modules/eat-config.el
+++ b/modules/eat-config.el
@@ -36,12 +36,25 @@
(hl-line-mode -1)
(display-line-numbers-mode -1))
+(defun cj/--eat-tame-scroll ()
+ "Reduce the viewport bounce from full-frame inline redraws (Claude Code).
+Such programs move the terminal cursor up to redraw their whole block and back
+to the bottom on every tick; EAT follows the cursor with point, so the window
+chases it. Line-scroll minimally instead of recentering, drop the scroll
+margin, and disable auto vscroll, so the window follows with the smallest
+movement. It cannot fully remove the bounce -- the inline redraw is the root --
+but it makes each jump gentler."
+ (setq-local scroll-conservatively 101)
+ (setq-local scroll-margin 0)
+ (setq-local auto-window-vscroll nil))
+
;; ------------------------------- eat package ---------------------------------
(use-package eat
:ensure t
:commands (eat)
- :hook (eat-mode . cj/turn-off-chrome-for-term)
+ :hook ((eat-mode . cj/turn-off-chrome-for-term)
+ (eat-mode . cj/--eat-tame-scroll))
:custom
;; Close the EAT buffer when its shell exits.
(eat-kill-buffer-on-exit t)