diff options
| -rw-r--r-- | elisp/geiser-base.el | 5 | ||||
| -rw-r--r-- | elisp/geiser-connection.el | 2 | ||||
| -rw-r--r-- | elisp/geiser-repl.el | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/elisp/geiser-base.el b/elisp/geiser-base.el index 4194da5..71aa8b4 100644 --- a/elisp/geiser-base.el +++ b/elisp/geiser-base.el @@ -41,9 +41,14 @@ ;;; Utilities: +(require 'ansi-color) + (defsubst geiser--chomp (str) (if (string-match-p ".*\n$" str) (substring str 0 -1) str)) +(defsubst geiser--strip-ansi (s) + (replace-regexp-in-string "" "" (ansi-color-filter-apply s))) + (defun geiser--shorten-str (str len &optional sep) (let ((str-len (length str))) (if (<= str-len len) diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el index 74f620b..f462b4c 100644 --- a/elisp/geiser-connection.el +++ b/elisp/geiser-connection.el @@ -81,7 +81,7 @@ (progn (geiser-log--error "Unexpected queue input:\n %s" in) (delete-region (point-min) (point-max))) (goto-char (point-max)) - (insert in) + (insert (geiser--strip-ansi in)) (goto-char (point-min)) (when (re-search-forward (tq-queue-head-regexp tq) nil t) (unwind-protect diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index eff1419..8594462 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -1154,7 +1154,7 @@ buffer." (geiser-repl-autoeval-mode 1)) (when geiser-repl-superparen-mode-p (geiser-repl-superparen-mode 1)) - + (add-hook 'comint-preoutput-filter-functions #'geiser--strip-ansi nil t) ;; enabling compilation-shell-minor-mode without the annoying highlighter (compilation-setup t)) |
