summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2024-01-06 14:17:12 -0500
committerKjetil Orbekk <kj@orbekk.com>2024-01-06 14:17:12 -0500
commitdf17eea6b145553b89f2f10a18d812c366883325 (patch)
tree4bb676dee2186452970bc4ca1197d5ccbe1f5ddc
parentb217d9ba56368761146c0a00139d92bcfab708e8 (diff)
improve shell history
-rw-r--r--emacs/.config/emacs-kj/lisp/kj-history.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/emacs/.config/emacs-kj/lisp/kj-history.el b/emacs/.config/emacs-kj/lisp/kj-history.el
index 0b70508..2e90e81 100644
--- a/emacs/.config/emacs-kj/lisp/kj-history.el
+++ b/emacs/.config/emacs-kj/lisp/kj-history.el
@@ -23,7 +23,10 @@
(let ((result))
(save-match-data
(while (re-search-forward kj/history-regexp nil t)
- (push (match-string-no-properties 1) result)))
+ (let ((command
+ ;; Fix up multi-line commands.
+ (string-replace "\\\\n" "\\\n" (match-string-no-properties 1))))
+ (push command result))))
result)))
(defun kj/consult-history ()