You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the following snippet from Spacemacs to prevent modification of the 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
is achieved by adding the relevant text properties."
(let ((inhibit-field-text-motion t))
(add-text-properties
(point-at-bol)
(point)
'(rear-nonsticky t
inhibit-line-move-field-capture t
field output
read-only t
front-sticky (field inhibit-line-move-field-capture)))))
However, as a result of the additional text properties, (beginning-of-line) in esh-autosuggest--prefix stops right after the prompt instead of at the beginning of the prompt. This causes the while loop to fail. Perhaps we can use something like (re-search-backward "^" nil 'noerror) instead?
As a side question, can we check if (eshell-bol) returns nil and then use the result of re-search-forward? Not really sure why we need (eshell-bol) here.
Thanks!
The text was updated successfully, but these errors were encountered:
Sorry for the years late reply - re: your aside, we might not need (eshell-boll) at all, it seems the call to re-seach-forward puts us in the right place anyway. The logic in this bit of the code feels a bit hacked together and could probably be cleaned up some.
Re: the main issue: does replacing (beginning-of-line) with (forward-line 0) solve your issue?
I'm using the following snippet from Spacemacs to prevent modification of the eshell prompt:
However, as a result of the additional text properties,
(beginning-of-line)
in esh-autosuggest--prefix stops right after the prompt instead of at the beginning of the prompt. This causes the while loop to fail. Perhaps we can use something like(re-search-backward "^" nil 'noerror)
instead?As a side question, can we check if
(eshell-bol)
returns nil and then use the result ofre-search-forward
? Not really sure why we need(eshell-bol)
here.Thanks!
The text was updated successfully, but these errors were encountered: