Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Emacs, I routinely use an inferior shell, invoked with M-x shell. I often need to specifically set its coding system, which I do with C-x RET p followed by utf-8 (twice).

I want to do this once and for all in my .emacs file. The documentation says that the default coding system for shells started via M-x shell comes from process-coding-system-alist. After consulting the documentation for this variable, I tried

(add-to-list 'process-coding-system-alist '("zsh" . utf-8))

...since zsh is my default shell. (According to the docs, the first element of the added pair is interpreted as a regex matching the shell program's name, so the string shown above should work.)

This, however, fails to produce the desired result. (E.g. some characters are not properly displayed in stdout in a freshly started *shell*; nevertheless, these characters are properly displayed once I execute C-x RET p, etc., as described above. This means that, whatever my add-to-list command is doing, it is not doing what I want it to do.)

My question is simply, why doesn't'

(add-to-list 'process-coding-system-alist '("zsh" . utf-8))


NB: there may be other ways to achieve the same result, but here I am specifically interested in understanding why what I tried did not work, and fix it.

share|improve this question
Did you try starting emacs with "Toggle debug on error" to check if it correctly reads that line? – T. Verron May 16 '12 at 22:15

I'm not sure about this and I don't really have a way to replicate it, but are you not missing a pair of parentheses, around utf-8?

(add-to-list 'process-coding-system-alist '("zsh" . (utf-8)))
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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