diff options
| author | Michael Albinus | 2018-04-23 10:01:27 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-04-23 10:01:27 +0200 |
| commit | e7044d294c1b1779b3124b27ba0f09b22b64df20 (patch) | |
| tree | cf248ce5f4382d67278bb8d18a7093fb1bcf6c98 | |
| parent | 7abd3f2dcf1d31e31f40ca817666e8f66a17284f (diff) | |
| download | emacs-e7044d294c1b1779b3124b27ba0f09b22b64df20.tar.gz emacs-e7044d294c1b1779b3124b27ba0f09b22b64df20.zip | |
Ensure proper EOL handling for Tramp on macOS
* lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
Ensure proper EOL handling for Darwin.
| -rw-r--r-- | lisp/net/tramp-sh.el | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2fb5566a3bf..58982e58bb1 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -4157,7 +4157,10 @@ process to set up. VEC specifies the connection." | |||
| 4157 | (with-current-buffer (process-buffer proc) | 4157 | (with-current-buffer (process-buffer proc) |
| 4158 | ;; Use MULE to select the right EOL convention for communicating | 4158 | ;; Use MULE to select the right EOL convention for communicating |
| 4159 | ;; with the process. | 4159 | ;; with the process. |
| 4160 | (let ((cs (or (and (memq 'utf-8 (coding-system-list)) | 4160 | (let ((cs (or (and (memq 'utf-8-hfs (coding-system-list)) |
| 4161 | (string-match "^Darwin" uname) | ||
| 4162 | (cons 'utf-8-hfs 'utf-8-hfs)) | ||
| 4163 | (and (memq 'utf-8 (coding-system-list)) | ||
| 4161 | (string-match "utf-?8" (tramp-get-remote-locale vec)) | 4164 | (string-match "utf-?8" (tramp-get-remote-locale vec)) |
| 4162 | (cons 'utf-8 'utf-8)) | 4165 | (cons 'utf-8 'utf-8)) |
| 4163 | (process-coding-system proc) | 4166 | (process-coding-system proc) |
| @@ -4173,11 +4176,6 @@ process to set up. VEC specifies the connection." | |||
| 4173 | (goto-char (point-min)) | 4176 | (goto-char (point-min)) |
| 4174 | (when (search-forward "\r" nil t) | 4177 | (when (search-forward "\r" nil t) |
| 4175 | (setq cs-decode (coding-system-change-eol-conversion cs-decode 'dos))) | 4178 | (setq cs-decode (coding-system-change-eol-conversion cs-decode 'dos))) |
| 4176 | ;; Special setting for macOS. | ||
| 4177 | (when (and (string-match "^Darwin" uname) | ||
| 4178 | (memq 'utf-8-hfs (coding-system-list))) | ||
| 4179 | (setq cs-decode 'utf-8-hfs | ||
| 4180 | cs-encode 'utf-8-hfs)) | ||
| 4181 | (set-process-coding-system proc cs-decode cs-encode) | 4179 | (set-process-coding-system proc cs-decode cs-encode) |
| 4182 | (tramp-message | 4180 | (tramp-message |
| 4183 | vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))) | 4181 | vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))) |