From fd0f30afa00c8d5e93152c81e22493c15f4bbe61 Mon Sep 17 00:00:00 2001 From: Steve Molitor Date: Mon, 15 Sep 2025 08:09:19 -0500 Subject: [PATCH 1/2] Update changelog, version, readme fix --- CHANGELOG.md | 10 ++++++++++ README.md | 2 +- claude-code.el | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 462e435..5ddba06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to claude-code.el will be documented in this file. +## [0.4.5] + +### Added +- New `claude-code-display-window-fn` customization option (#100) to control display of Claude COde buffer + +### Changed + +### Fixed +- Fixed bug reporting line position when narrowring is in effect (#74) + ## [0.4.4] ### Added diff --git a/README.md b/README.md index 923e559..ad67952 100644 --- a/README.md +++ b/README.md @@ -574,7 +574,7 @@ You can customize how Claude Code windows are displayed by setting `claude-code- #### Using display-buffer-alist -You can also control how the Claude Code window appears using Emacs' `display-buffer-alist`. For example, to make the Claude window appear in a persistent side window on the right side of your screen with 33% width: +You can also control how the Claude Code window appears using Emacs' `display-buffer-alist`. For example, to make the Claude window appear in a persistent side window on the right side of your screen that is 90 characters wide: ```elisp (add-to-list 'display-buffer-alist diff --git a/claude-code.el b/claude-code.el index 97df32c..1472da7 100644 --- a/claude-code.el +++ b/claude-code.el @@ -1,7 +1,7 @@ ;;; claude-code.el --- Claude Code Emacs integration -*- lexical-binding: t; -*- ;; Author: Stephen Molitor -;; Version: 0.4.4 +;; Version: 0.4.5 ;; Package-Requires: ((emacs "30.0") (transient "0.9.3")) ;; Keywords: tools, ai ;; URL: https://github.com/stevemolitor/claude-code.el From 7932117bd53b1d0594c220041f407e79726d0a64 Mon Sep 17 00:00:00 2001 From: Steve Molitor Date: Mon, 15 Sep 2025 08:26:44 -0500 Subject: [PATCH 2/2] Fix scrolling issue in vterm. Fix issue in vterm to allow the user to scroll the Claude buffer while the LLM is streaming a response. See [issue comment](https://github.com/stevemolitor/claude-code.el/issues/68#issuecomment-3259335492). --- claude-code.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/claude-code.el b/claude-code.el index 1472da7..2c9a92a 100644 --- a/claude-code.el +++ b/claude-code.el @@ -790,6 +790,17 @@ _BACKEND is the terminal backend type (should be \\='vterm)." _BACKEND is the terminal backend type (should be \\='vterm)." vterm-copy-mode) +(defun claude-code--vterm-window-scroll-advice (&rest _) + "Turn on vterm-copy-mode when scrolling in vterm claude buffer. + +This allows the user to scroll backwards while the LLM is outputing new +text." + (advice-add 'set-window-vscroll :after + (when (and (claude-code--buffer-p (current-buffer)) (eq major-mode 'vterm-mode)) + (if (> (window-end) (buffer-size)) + (when vterm-copy-mode (claude-code-exit-read-only-mode)) + (claude-code-read-only-mode))))) + (cl-defmethod claude-code--term-configure ((_backend (eql vterm))) "Configure vterm terminal in current buffer. @@ -817,7 +828,9 @@ _BACKEND is the terminal backend type (should be \\='vterm)." ;; Set up bell detection advice (advice-add 'vterm--filter :around #'claude-code--vterm-bell-detector) ;; Set up multi-line buffering to prevent flickering - (advice-add 'vterm--filter :around #'claude-code--vterm-multiline-buffer-filter)) + (advice-add 'vterm--filter :around #'claude-code--vterm-multiline-buffer-filter) + ;; Allow scrolling in Claude buffer when LLM is streaming a response + (advice-add 'set-window-vscroll :after #'claude-code--adjust-window-size-advice)) (cl-defmethod claude-code--term-customize-faces ((_backend (eql vterm))) "Apply face customizations for vterm terminal.