shell: Fix ambrevar/shell-command-duration.
parent
150bb1f80c
commit
86e145008f
|
@ -43,8 +43,11 @@ prefix arg shell buffer doesn't exists, create it and switch to it."
|
||||||
(defun ambrevar/shell-setup ()
|
(defun ambrevar/shell-setup ()
|
||||||
(set (make-variable-buffer-local 'comint-input-history-ignore)
|
(set (make-variable-buffer-local 'comint-input-history-ignore)
|
||||||
(regexp-opt '("^#" "^ " "^cd ")))
|
(regexp-opt '("^#" "^ " "^cd ")))
|
||||||
|
;; Only ending with '#' or '$' but seems slower:
|
||||||
|
;; (setq comint-prompt-regexp "^[^#$]*
|
||||||
|
;; [^#$]*[#$>] +")
|
||||||
(setq comint-prompt-regexp "^[^#$%>]*
|
(setq comint-prompt-regexp "^[^#$%>]*
|
||||||
[^#$%>]*[#$%>] *"))
|
[^#$%>]*[#$%>] +"))
|
||||||
|
|
||||||
(add-hook 'shell-mode-hook 'ambrevar/shell-setup)
|
(add-hook 'shell-mode-hook 'ambrevar/shell-setup)
|
||||||
|
|
||||||
|
@ -109,7 +112,8 @@ In normal circumstances this input is additionally filtered by
|
||||||
(ambrevar/shell-prompt-begin-position)
|
(ambrevar/shell-prompt-begin-position)
|
||||||
'help-echo))))
|
'help-echo))))
|
||||||
(end (parse-time-string (save-excursion
|
(end (parse-time-string (save-excursion
|
||||||
(call-interactively 'comint-next-prompt)
|
(goto-char (ambrevar/shell-prompt-end-position))
|
||||||
|
(call-interactively #'comint-next-prompt)
|
||||||
(ambrevar/shell-prompt)))))
|
(ambrevar/shell-prompt)))))
|
||||||
(if begin
|
(if begin
|
||||||
(message "Command took %.0f seconds."
|
(message "Command took %.0f seconds."
|
||||||
|
|
Loading…
Reference in New Issue