Unicode characters in emacs term-mode

后端 未结 3 1389
遇见更好的自我
遇见更好的自我 2020-12-14 04:33

I use ansi-term for my normal terminal sessions. I tend to use unicode characters in my prompt to do things like set the trailing character based on the type of source cont

3条回答
  •  猫巷女王i
    2020-12-14 04:52

    After getting a better understanding of term.el, the following works:

    (defadvice ansi-term (after advise-ansi-term-coding-system)
        (set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix))
    (ad-activate 'ansi-term)
    

    Trying this with term-mode-hook is broken because in term.el, term-mode-hook is called before switching to the terminal buffer, so set-buffer-process-coding-system breaks due to the lack of a process associated with the buffer.

提交回复
热议问题