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
Try
(set-terminal-coding-system 'utf-8-unix)
That's C-x RET t
not C-x RET p
.
So C-x RET p
helps?
Unless C-h v default-process-coding-system
is (utf-8-unix . utf-8-unix)
try
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
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.
The following worked for me:
(add-hook 'term-exec-hook
(function
(lambda ()
(set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix))))
ansi-term
seems to ignore the default-process-coding-system
variable, so I had to set it buffer-locally after it executes my shell.