Function: ghostel-shell-history
ghostel-shell-history is a natively compiled function defined in
ghostel-shell.el.
Signature
(ghostel-shell-history)
Documentation
Return the current buffer's shell history, newest first.
Runs the shell's entry from ghostel-shell-history-commands (which
see for the output contract). Signals user-error when the buffer's
shell is unrecognized, no command is configured for it, the command
fails, or the history is empty.
Source Code
;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-shell.el
(defun ghostel-shell-history ()
"Return the current buffer's shell history, newest first.
Runs the shell's entry from `ghostel-shell-history-commands' (which
see for the output contract). Signals `user-error' when the buffer's
shell is unrecognized, no command is configured for it, the command
fails, or the history is empty."
(ghostel--ensure-ghostel-buffer)
(let ((shell-type (and ghostel--shell-program
(ghostel--detect-shell ghostel--shell-program))))
(unless shell-type
(user-error "Buffer has no recognized shell"))
(let ((command (alist-get shell-type ghostel-shell-history-commands)))
(unless command
(user-error
"No entry for `%s' in `ghostel-shell-history-commands'" shell-type))
(or (if (functionp command)
(funcall command)
(ghostel--shell-history-run command))
(user-error "History is empty")))))