I use colorized output in ghci. And if run it:

  • in comint-mode, or in eshell, then colors displayed fine, but a lot of escape sequences displayed like ^A^Bλ ^A^B> ^A^B^B.
  • in ansi-term, then I got much better result like λ > ^B.
  • in tmux in ansi-term it displayed perfect (like colored λ >) but except performance.

Why output speed reduced so significant in this case?

Not sure if this information may be helpful: emacs launched under tmux (surely, it in different tmuxsession, than that in ansi-term with ghci) in rxvt-unicode terminal emulator.

UPD: prompt example :set prompt "\001\ESC[33m\002λ \001\ESC[01;34m\002> \001\ESC[m\002\STX"

  • "in comint-mode[...] a lot of escape sequences[...]" - have you tried ansi-color-for-comint-mode-on?
    – npostavs
    Jun 1 '16 at 13:59
  • Whenever I use tmux in any of the terminals I get weird visuals and effects when I type clear. Do any of the terminals (dumb or otherwise) actually work?
    – Jules
    Jun 1 '16 at 14:00
  • @npostavs ELISP> ansi-color-for-comint-mode t
    – Netsu
    Jun 1 '16 at 15:05
  • @JulesTamagnan yes, in plain urxvt and tmux all just fine.
    – Netsu
    Jun 1 '16 at 15:06
  • more pointers at: unix.stackexchange.com/a/41227
    – Emacs User
    Jun 1 '16 at 21:11

twb knows all! Tell your friends!

Thanks to helpful advises from @twb from #emacs IRC channel. Here's solution for such cases. Bug was in escape sequences which used use for ghci promt. It was expect that terminal will be xterm-compatible. But it don't. More proper way is to use tput like set_fg_red=$(tput setaf 1) reset=$(tput sgr0) or check $TERM for compatibility (such like vt100, dumb, emacs).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.