Emacs 30.1!!!
This commit is contained in:
@ -61,7 +61,8 @@ appear at most once to denote \"all remaining modules\"."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom eshell-starship-overridden-remote-methods
|
||||
'("docker" "podman" "kubernetes" "doas" "su" "sudo" "sudoedit")
|
||||
'("docker" "podman" "kubernetes" "doas" "su" "sudo" "sudoedit" "dockercp"
|
||||
"podmancp" "toolbox" "distrobox" "flatpak" "apptainer" "nspawn" "run0")
|
||||
"List of `file-remote-p' mwthods that should NOT be considered remote.
|
||||
Any eshell buffer with a `default-directory' managed by one of these methods
|
||||
will not be considered remote and all modules that would be disabled because of
|
||||
@ -430,7 +431,7 @@ should be as for `eshell-starship--git-interpret-branch-status'."
|
||||
(not (zerop behind)))
|
||||
(when merge-conflicts "=")
|
||||
(when stash "$")
|
||||
(apply 'string (sort (seq-uniq status-chars) #'<)))))
|
||||
(apply 'string (sort (seq-uniq status-chars))))))
|
||||
|
||||
(defun eshell-starship--git-current-operation ()
|
||||
"Return the current git operation.
|
||||
@ -758,7 +759,7 @@ This does not mean anything if pyenv-mode is not installed.")
|
||||
:predicate
|
||||
(lambda ()
|
||||
(member (file-remote-p default-directory 'method)
|
||||
'("doas" "sudo" "su" "sudoedit")))
|
||||
'("doas" "sudo" "su" "sudoedit" "run0")))
|
||||
:action
|
||||
(lambda ()
|
||||
(format "%s in"
|
||||
@ -769,7 +770,7 @@ This does not mean anything if pyenv-mode is not installed.")
|
||||
|
||||
(eshell-starship-defmodule newline
|
||||
:predicate 'always
|
||||
:action (lambda () (propertize "\n" 'read-only t 'rear-nonsticky t))
|
||||
:action (lambda () (progn "\n"))
|
||||
:doc "A newline in the prompt.")
|
||||
|
||||
(eshell-starship-defmodule container
|
||||
@ -777,7 +778,8 @@ This does not mean anything if pyenv-mode is not installed.")
|
||||
:color "firebrick"
|
||||
:predicate (lambda ()
|
||||
(member (file-remote-p default-directory 'method)
|
||||
'("docker" "podman" "kubernetes")))
|
||||
'("docker" "podman" "kubernetes" "dockercp" "podmancp"
|
||||
"toolbox" "distrobox" "flatpak" "apptainer" "nspawn")))
|
||||
:action (lambda ()
|
||||
(format "[%s]" (file-remote-p default-directory 'host)))
|
||||
:reload-on 'cwd
|
||||
@ -791,8 +793,7 @@ This does not mean anything if pyenv-mode is not installed.")
|
||||
"❯ " 'face `(:foreground
|
||||
,(if (= eshell-last-command-status 0)
|
||||
"lime green"
|
||||
"red"))
|
||||
'rear-nonsticky t))
|
||||
"red"))))
|
||||
:doc "An arrow that appears next to where you type.")
|
||||
|
||||
|
||||
@ -989,7 +990,9 @@ Return a hash table mapping module names to their output."
|
||||
(concat
|
||||
(unless (<= (line-number-at-pos) 3)
|
||||
"\n")
|
||||
(eshell-starship--build-module-string)))
|
||||
(let ((mods (eshell-starship--build-module-string)))
|
||||
(add-face-text-property 0 (length mods) 'default t mods)
|
||||
mods)))
|
||||
|
||||
(defvar-local eshell-starship--last-prompt-info nil
|
||||
"A list of the last prompt and the time it took to render it.")
|
||||
@ -1020,11 +1023,7 @@ Return a hash table mapping module names to their output."
|
||||
"Enable eshell-starship."
|
||||
(setq-local eshell-starship--restore-state
|
||||
(buffer-local-set-state
|
||||
eshell-prompt-function
|
||||
'eshell-starship--prompt-function
|
||||
;; temporary fix until the next version where eshell uses fields
|
||||
eshell-prompt-regexp (rx bol (? "⬢ [" (+ any) "] ") "❯ ")
|
||||
eshell-highlight-prompt nil)
|
||||
eshell-prompt-function 'eshell-starship--prompt-function)
|
||||
eshell-starship--module-cache (make-hash-table :test 'equal))
|
||||
(add-hook 'eshell-pre-command-hook
|
||||
#'eshell-starship--run-module-precmd-actions nil t)
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user