diff --git a/contrib/shell/README.org b/contrib/shell/README.org index ead2d5a3b..bb7ff3d2a 100644 --- a/contrib/shell/README.org +++ b/contrib/shell/README.org @@ -113,12 +113,13 @@ work sensibly. E.g. you can press ~cc~ in normal state i.e. =evil-change-whole-line= to kill the current input and start typing a new command. In Eshell you also kill the prompt, which is often unintended. -To enable a the same behavior as in Comint mode you can enable the following -variable: +By default this layer also protects the =ehsell= prompt. If you want to +disable this protection you can set the variable =shell-protect-eshell-prompt= +to nil. #+BEGIN_SRC emacs-lisp (setq-default dotspacemacs-configuration-layers - '(shell :variables shell-protect-eshell-prompt t)) + '(shell :variables shell-protect-eshell-prompt nil)) #+END_SRC * Eshell diff --git a/contrib/shell/config.el b/contrib/shell/config.el index 5d56f6c08..fe6352ef6 100644 --- a/contrib/shell/config.el +++ b/contrib/shell/config.el @@ -33,7 +33,7 @@ "If non-nil then `em-smart' is enabled. `em-smart' allows to quickly review commands, modify old commands or enter a new one.") -(defvar shell-protect-eshell-prompt nil +(defvar shell-protect-eshell-prompt t "If non-nil then eshell's prompt is protected. This means that - that movement to the prompt is inhibited like for `comint-mode' - prompts and the prompt is made read-only") +movement to the prompt is inhibited like for `comint-mode' +prompts and the prompt is made read-only") diff --git a/contrib/shell/packages.el b/contrib/shell/packages.el index 60d08cc1a..abd36d1a4 100644 --- a/contrib/shell/packages.el +++ b/contrib/shell/packages.el @@ -70,7 +70,7 @@ the user activate the completion manually." (end-of-buffer))) (when shell-protect-eshell-prompt - (defun protect-eshell-prompt () + (defun spacemacs//protect-eshell-prompt () "Protect Eshell's prompt like Comint's prompts. E.g. `evil-change-whole-line' won't wipe the prompt. This @@ -84,7 +84,7 @@ is achieved by adding the relevant text properties." field output read-only t front-sticky (field inhibit-line-move-field-capture))))) - (add-hook 'eshell-after-prompt-hook 'protect-eshell-prompt)) + (add-hook 'eshell-after-prompt-hook 'spacemacs//protect-eshell-prompt)) (defun spacemacs//init-eshell () "Stuff to do when enabling eshell."