From 874d638db9fc0b36b6c1176252c77ed2feba046b Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 29 Nov 2021 11:10:56 -0800 Subject: emacs: try to fix prompt --- emacs/custom/fcuny-eshell.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'emacs') diff --git a/emacs/custom/fcuny-eshell.el b/emacs/custom/fcuny-eshell.el index fce4ccb..f4b0737 100644 --- a/emacs/custom/fcuny-eshell.el +++ b/emacs/custom/fcuny-eshell.el @@ -103,8 +103,8 @@ host and starts with `ssh:', then we replace the prompt with (let ((absolute-path (eshell/pwd))) (if (string-match "/ssh:\\(.+\\):" absolute-path) (replace-match (concat "@" (match-string 1 absolute-path) " ") nil nil absolute-path) - (fcuny/shorten-path absolute-path))) - "; ")) + (fcuny/shorten-path absolute-path))) + (if (= (user-uid) 0) " # " " $ "))) (defun fcuny/eshell-here () "Opens up a new shell in the directory associated with the current @@ -200,7 +200,7 @@ append to it, while separating multiple outputs with (eshell-review-quick-commands nil) (eshell-smart-space-goes-to-end t) (eshell-prompt-function 'fcuny/eshell-prompt) - (eshell-prompt-regexp "^[^;]*; ") + (tramp-shell-prompt-pattern "^[^$>\n]*[#$%>] *\\(\[[0-9;]*[a-zA-Z] *\\)*") (eshell-destroy-buffer-when-process-dies t)) (use-package eshell-bookmark -- cgit 1.4.1