Variable: ghostel-shell-history-commands

ghostel-shell-history-commands is a customizable variable defined in ghostel-shell.el.

Value

((bash . "bash -ic 'history -r; fc -lnr 1'")
 (zsh . "zsh -ic 'fc -R; fc -lnr 1'") (fish . "fish -c 'history -z'")
 (nu . "nu -c 'history | get command | reverse | to text'"))

Documentation

Command printing a shell's history, keyed by shell type.

Keys are shell type symbols (bash, zsh, fish, nu). A string value is run with "/bin/sh -c" through process-file, so a remote buffer queries the remote host; it must print one history entry per line, newest first. Output containing a NUL byte is split on NUL instead, letting multi-line entries survive (e.g. fish's history -z). Entries are trimmed of surrounding whitespace.

A function value is called with no arguments in the terminal's buffer and must return the list of entries itself, newest first. History managers replace the shell's entry, e.g.:

  (setf (alist-get 'zsh ghostel-shell-history-commands)
        "atuin history list --cmd-only --print0 --reverse false")

Used by ghostel-shell-history.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-shell.el
(defcustom ghostel-shell-history-commands
  '((bash . "bash -ic 'history -r; fc -lnr 1'")
    (zsh  . "zsh -ic 'fc -R; fc -lnr 1'")
    (fish . "fish -c 'history -z'")
    (nu   . "nu -c 'history | get command | reverse | to text'"))
  "Command printing a shell's history, keyed by shell type.
Keys are shell type symbols (`bash', `zsh', `fish', `nu').  A string
value is run with \"/bin/sh -c\" through `process-file', so a remote
buffer queries the remote host; it must print one history entry per
line, newest first.  Output containing a NUL byte is split on NUL
instead, letting multi-line entries survive (e.g. fish's `history -z').
Entries are trimmed of surrounding whitespace.

A function value is called with no arguments in the terminal's buffer
and must return the list of entries itself, newest first.  History
managers replace the shell's entry, e.g.:

  (setf (alist-get \\='zsh ghostel-shell-history-commands)
        \"atuin history list --cmd-only --print0 --reverse false\")

Used by `ghostel-shell-history'."
  :type '(alist :key-type symbol
                :value-type (choice string function))
  :group 'ghostel)