From e41e62d6dcc275f5e07aca455839590d8b005561 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 1 Jun 2025 09:51:11 +0200 Subject: [PATCH] Improve window placement for shell windows Allow splitting windows vertically when height is a bit lower (as is on my machine), so that shell buffers can appear also in a smaller windows. Also reuse windows that already display a shell buffer to be able to jump to them (and avoid duplicate windows). --- init.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 9a62e84..8ad6ae3 100644 --- a/init.el +++ b/init.el @@ -355,7 +355,9 @@ :init (setq switch-to-buffer-obey-display-actions t switch-to-buffer-in-dedicated-window 'pop recenter-positions '(top middle bottom) - display-buffer-base-action '(display-buffer-reuse-window)) + display-buffer-base-action '(display-buffer-reuse-window) + split-height-threshold 50 + split-width-threshold 140) :config (progn (add-to-list 'display-buffer-alist '("^\\*Async Shell Command*" @@ -392,7 +394,8 @@ (add-to-list 'display-buffer-alist '("shell\\*" - (display-buffer-pop-up-window))))) + (display-buffer-reuse-window + display-buffer-pop-up-window))))) (use-package which-key :ensure t