diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2025-04-06 20:22:58 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2025-04-06 21:36:41 +0100 |
| commit | c3257933c17ec368c0db4c401cdd89914c4a1eea (patch) | |
| tree | f748b5fb0a68fac6647e6a72ee5d997919e87ad3 | |
| parent | d2b118afc0b349a1a0c1c79dd946d8e0df1f98e5 (diff) | |
emacs: Only insert prompt if no command is running
| -rw-r--r-- | emacs/init.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/emacs/init.el b/emacs/init.el index 7ea5eaf..7fe90dd 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -218,10 +218,12 @@ :config (defun my/eshell-clear () (interactive) - (let ((input (eshell-get-old-input))) - (eshell/clear-scrollback) - (eshell-emit-prompt) - (insert input))) + (if eshell-foreground-command + (eshell/clear-scrollback) + (let ((input (eshell-get-old-input))) + (eshell/clear-scrollback) + (eshell-emit-prompt) + (insert input)))) :bind (("C-c e" . eshell) :map eshell-mode-map ("s-l" . my/eshell-clear)) |
