I found new possible solution:

comint-based modes like shell-mode use functions in hook.

Like

- ansi-color-process-output

And I found similar project "xterm-color":

https://github.com/atomontage/xterm-color

I can't implement it on Org-mode result processing.

But someone might be interested this and can take a try. Thanks.


On 03/24/2018 09:14 AM, stardiviner wrote:

When I have following src block

#+begin_src shell :dir /sudo::
sudo pacman -S --noconfirm lilypond
#+end_src

It will display result literately. include "^M".

I wish org-mode (or ob-shell) can add a result type like `:results term` (maybe other name) to replace those "^M" etc special characters and might convert some shell color highlight special sequences like [[45 similar things.