File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 76
76
" Double-quote S, escaping any double-quotes already contained in it."
77
77
(concat " \" " (replace-regexp-in-string " \" " " \\\\ \" " s) " \" " ))
78
78
79
+ (defun exec-path-from-shell--login-arg (shell )
80
+ " Return the name of the --login arg for SHELL."
81
+ (if (string-match " tcsh$" shell) " -d" " -l" ))
82
+
79
83
(defun exec-path-from-shell-printf (str &optional args )
80
84
" Return the result of printing STR in the user's shell.
81
85
@@ -92,8 +96,10 @@ shell-escaped, so they may contain $ etc."
92
96
(concat " printf '__RESULT\\ 000" str " ' "
93
97
(mapconcat #'exec-path-from-shell--double-quote args " " ))))
94
98
(with-temp-buffer
95
- (call-process (getenv " SHELL" ) nil (current-buffer ) nil
96
- " --login" " -i" " -c" printf-command)
99
+ (let ((shell (getenv " SHELL" )))
100
+ (call-process shell nil (current-buffer ) nil
101
+ (exec-path-from-shell--login-arg shell)
102
+ " -i" " -c" printf-command))
97
103
(goto-char (point-min ))
98
104
(when (re-search-forward " __RESULT\0 \\ (.*\\ )" nil t )
99
105
(match-string 1 )))))
You can’t perform that action at this time.
0 commit comments