Skip to content

Instantly share code, notes, and snippets.

@corpix
Last active June 27, 2023 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corpix/b04b0a5535afa400280ee489eef90dce to your computer and use it in GitHub Desktop.
Save corpix/b04b0a5535afa400280ee489eef90dce to your computer and use it in GitHub Desktop.
(defun use-ansi-process-filter (process)
(set-process-filter
process
(lambda (process string)
(internal-default-process-filter process string)
(with-current-buffer (process-buffer process)
(save-excursion
(goto-char (point-max))
(let ((previous-point-max (point-max)))
(insert string)
(ansi-color-apply-on-region previous-point-max (point-max)))))))
process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment