1

Using the configuration

(eval-after-load "em-term"
  '(progn
     (add-to-list 'eshell-visual-subcommands '("git" "diff" "help" "log" "show"))
     (add-to-list 'eshell-visual-options '("git" "--help" "--paginate"))))

eshell opens git help diff in a term-mode buffer. The buffer file coding system of this buffer is set to utf-8.

Even so utf-8 characters in the output of git help diff are shown as octal codes (see doesn't in the last line):

--full-diff
    Without this flag, git log -p <path>...  shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch the
    specified paths; this means that "<path>..." limits only commits, and doesn\342\200\231t limit diff for those commits.

I assume that the problem is connected to the following section of the function term-exec-1:

;; The process's output contains not just chars but also binary
;; escape codes, so we need to see the raw output.  We will have to
;; do the decoding by hand on the parts that are made of chars.
(coding-system-for-read 'binary)

Is there a workaround?

I 've tried the method described in "Unicode characters in emacs term-mode". They don't work.

Tobias
  • 32,569
  • 1
  • 34
  • 75

1 Answers1

1

I found the lines

;; display of certain characters and control codes to UTF-8
(defun my-term-use-utf8 ()
  (set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix))
(add-hook 'term-exec-hook 'my-term-use-utf8)

in the ansi-term configuration of user space_voyager in his question "ansi-term changes in line-mode not registered after char-mode".

These lines work for me (emacs 25.2.1 on cygwin).

Tobias
  • 32,569
  • 1
  • 34
  • 75