commit 7188ed770019a169fed27713bf447f3daf6b9051
parent 0ece370405487760ffa90d5da156f032f6f74638
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date: Sun, 21 Jun 2026 21:45:52 +0200
Make M-x shell more colorful
Diffstat:
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el
@@ -9,7 +9,6 @@
'(auto-revert-avoid-polling t)
'(backup-directory-alist '(("" . "~/.emacs.backup")))
'(column-number-mode t)
- '(comint-scroll-show-maximum-output nil)
'(delete-selection-mode t)
'(describe-bindings-outline t)
'(diff-default-read-only t)
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
@@ -726,6 +726,26 @@ UPSTREAMS is a list of fetch URLs."
(calendar-today-visible-hook '(calendar-mark-today))
(calendar-week-start-day 1))
+(use-package comint
+ :custom
+ (comint-scroll-show-maximum-output nil)
+ ;; 'dumb-emacs-ansi' signals support for niceties like colors codes,
+ ;; but causes some programs to assume they should page output.
+ ;;
+ ;; E.g. python (Lib/_pyrepl/pager.py:get_pager) decides whether to
+ ;; page as follows (simplified):
+ ;;
+ ;; * TERM is 'dumb' or 'emacs'
+ ;; β disable paging;
+ ;; * TERM is anything else
+ ;; β run $MANPAGER, or $PAGER, or 'pager', or 'less'.
+ ;;
+ ;; So e.g. 'help()' will page, which is a nuisance.
+ ;;
+ ;; Set 'PAGER=cat' to explicitly opt out of paging.
+ (comint-terminfo-terminal "dumb-emacs-ansi")
+ (comint-pager "cat"))
+
(use-package diff-hl
:custom
(diff-hl-flydiff-mode t)