diff options
author | jjanzen <jjanzen@jjanzen.ca> | 2025-03-13 22:13:49 -0500 |
---|---|---|
committer | jjanzen <jjanzen@jjanzen.ca> | 2025-03-13 22:13:49 -0500 |
commit | 372e62aef511781adc3de82225a5bb21f7d75658 (patch) | |
tree | fa55ad803a55ff6a7e77db568834c3d86656385b | |
parent | b01c454264fc80338ab082f7a706c1c2493cf80e (diff) |
system changes
-rw-r--r-- | common/.config/emacs/init.el.org | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/common/.config/emacs/init.el.org b/common/.config/emacs/init.el.org index c681d2b..4d56977 100644 --- a/common/.config/emacs/init.el.org +++ b/common/.config/emacs/init.el.org @@ -316,6 +316,31 @@ Install and configure =eat= as a terminal emulator in Emacs with =eshell= as a s (setopt eat-kill-buffer-on-exit t) (eat-eshell-mode) + ;; Overwrite a default function that makes the prompt editable for some reason + (defun eshell-emit-prompt () + "Emit a prompt if eshell is being used interactively." + (when (boundp 'ansi-color-context-region) + (setq ansi-color-context-region nil)) + (run-hooks 'eshell-before-prompt-hook) + (if (not eshell-prompt-function) + (set-marker eshell-last-output-end (point)) + (let ((prompt (funcall eshell-prompt-function))) + (add-text-properties + 0 (length prompt) + (if eshell-highlight-prompt + '( read-only t + field prompt + font-lock-face eshell-prompt + front-sticky (read-only field font-lock-face) + rear-nonsticky (read-only field font-lock-face)) + '( read-only t + field prompt + front-sticky (read-only field font-lock-face) + rear-nonsticky (read-only field font-lock-face))) + prompt) + (eshell-interactive-filter nil prompt))) + (run-hooks 'eshell-after-prompt-hook)) + (defun jj/shorten-path-str (path) (let* ((components (split-string (replace-regexp-in-string (getenv "HOME") "~" path) "/")) (head-items (butlast components 2)) |