This library configures the terminal prompt (PS1 and PS2)
and window title (PS4) for your shell.
It's used by Homefries: https://github.com/landonb/home-fries 🍟
Prompt features:
Sports a different icon depending on what host you're on.
E.g., when logged on locally, you might see
user@local:~ 🍄 $
Or when logged on to a remote host over SSH, you might see instead:
user@remote:~ 💀 $
Prints the user name, hostname, and path in different colors.
Prints the final prompt character
$in red if the last command failed.Print the final prompt character in parentheses
($)when you're in the middle ofgit-rebase.
Window title features:
As you open new terminal windows, prepends a sequential number (from
1.to9.) to the window title.The 'dot' used is not a normal ASCII Full Stop period, but rather it's the Unicode One Dot Leader (U+2024).
You can use the number and the One Dot Leader to wire an OS Keyboard Shortcut to fronting each of your terminal windows!
I.e., no more Alt-tabbing or clicking to find your terminal windows, you can now hot-key directly to each one.
The author uses Hammerspoon to enable such functionality in macOS.
See
macOS-Hammyspoonyfor an example Spoon to wire the bindings:
For Linux MATE, the author uses a Keyboard Shortcut action like this:
'/home/user/.depoxy/ambers/bin/windows/toggle-visibility \\'1.\\' \\'1․\\''
which calls a script to front the specific terminal window if not fronted, or to minimize it if it's already got focus:
https://github.com/DepoXy/depoxy/blob/1.14.3/bin/windows/toggle-visibility
Prints the leading
~/in the window title when you're in a top-level user home directory (e.g.,~/.local).- Otherwise just prints the current directory name.
When executing a command, prints the command name in the window title.
For Wayland support, install window-calls GNOME Shell extension:
https://extensions.gnome.org/extension/4724/window-calls/
https://github.com/ickyicky/window-calls
The
window-callsextension lets this project get a list of window titles, so that it can determine the next window number to use for each new terminal window (which enables the terminal window hotkeys).E.g., if you want to list window titles, try:
gdbus call --session --dest org.gnome.Shell \ --object-path /org/gnome/Shell/Extensions/Windows \ --method org.gnome.Shell.Extensions.Windows.List
Note that
window-callsis a great replacement for X Window functionality you'd access viawmctrlorxdotool.- Or, if you're a macOS user,
window-callsenables a lot of functionality you might instead access using Hammerspoon.
- Or, if you're a macOS user,
Starship — "Cross-shell prompt"
The minimal, blazing-fast, and infinitely customizable prompt for any shell!