From 79a5c2dc942d224938e1f5039afe10e92b2ab16c Mon Sep 17 00:00:00 2001 From: Akib Azmain Turja Date: Sun, 27 Aug 2023 01:39:12 +0600 Subject: [PATCH] Support Sixel properly in Eshell * eat.el (eat--eshell-setup-proc-and-term): Set Sixel attributes of the terminal object. --- eat.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/eat.el b/eat.el index 62028db..323923e 100644 --- a/eat.el +++ b/eat.el @@ -6468,6 +6468,21 @@ PROGRAM can be a shell command." (setf (eat-term-ring-bell-function eat--terminal) #'eat--bell) (setf (eat-term-set-cwd-function eat--terminal) #'eat--set-cwd) (setf (eat-term-set-cmd-function eat--terminal) #'eat--set-cmd) + (setf (eat-term-parameter eat--terminal 'sixel-display-method) + (cond ((and (display-graphic-p) + (image-type-available-p 'svg)) + 'svg) + ((char-displayable-p ?▄) 'half-block) + (t 'background))) + (when (display-graphic-p) + (setf (eat-term-parameter eat--terminal 'sixel-image-height) + (cons (/ (float (default-font-height)) + (font-get + (font-spec :name (face-font 'default)) + :size)) + 'em))) + (setf (eat-term-parameter eat--terminal 'char-dimensions) + (cons (default-font-width) (default-font-height))) (setf (eat-term-parameter eat--terminal 'eat--process) proc) (unless (>= emacs-major-version 29) (setf (eat-term-parameter eat--terminal 'eat--input-process)