diff --git a/README.org b/README.org index 6f485dc..3305a44 100644 --- a/README.org +++ b/README.org @@ -19,6 +19,11 @@ The package isn't yet available anywhere but in this repository. My preferred wa Alternatively, clone the repository, add it to the =load-path=, and =require= the package. +If your version of =atuin= is less than 18, turn off saving command durations: +#+begin_src emacs-lisp +(setq eshell-atuin-save-duration nil) +#+end_src + * Configuration If your =atuin= binary is located in a place unknown to =executable-find=, set the =atuin-executable= variable. diff --git a/eshell-atuin.el b/eshell-atuin.el index 46cd31d..ddeeb43 100644 --- a/eshell-atuin.el +++ b/eshell-atuin.el @@ -81,6 +81,13 @@ will not work. (when (fboundp #'eshell-atuin--history-reset) (eshell-atuin--history-reset)))) +(defcustom eshell-atuin-save-duration t + "Whether to save command duration. + +Set to nil if your atuin version is less than 18." + :group 'eshell-atuin + :type 'boolean) + (defcustom eshell-atuin-history-format "%c" "How to format history items. @@ -154,7 +161,8 @@ of the command." `(,eshell-atuin-executable "history" "end" "--exit" ,(number-to-string eshell-last-command-status) - ,@(when eshell-atuin--last-command-start + ,@(when (and eshell-atuin--last-command-start + eshell-atuin-save-duration) (list "--duration" (prog1