Skip to content

Commit 95b7aee

Browse files
committed
Use -d in place of --login for tcsh (fixes purcell#7)
1 parent 54f272f commit 95b7aee

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

exec-path-from-shell.el

+8-2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
"Double-quote S, escaping any double-quotes already contained in it."
7777
(concat "\"" (replace-regexp-in-string "\"" "\\\\\"" s) "\""))
7878

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+
7983
(defun exec-path-from-shell-printf (str &optional args)
8084
"Return the result of printing STR in the user's shell.
8185
@@ -92,8 +96,10 @@ shell-escaped, so they may contain $ etc."
9296
(concat "printf '__RESULT\\000" str "' "
9397
(mapconcat #'exec-path-from-shell--double-quote args " "))))
9498
(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))
97103
(goto-char (point-min))
98104
(when (re-search-forward "__RESULT\0\\(.*\\)" nil t)
99105
(match-string 1)))))

0 commit comments

Comments
 (0)