PRWDRC(5)
okay bestie, sit down, hydrate, because we're reading PRWDRC(5) together β that's the prwdrc page from the File Formats Manual π it's giving "config file that runs your whole prompt" and honestly? iconic.
πΈ NAME πΈ
prwdrc β the prwd configuration file. yes that's it. that's the name. slay.
β¨ SYNOPSIS β¨
~/.prwdrc
one file. home directory. that's the whole vibe check π
π¦ DESCRIPTION π¦
The prwdrc file describes the template and various attributes affecting the behavior of prwd. The configuration file has the following format:
Empty lines and lines starting with # are comments, otherwise a line is of the format keyword arguments.... Configuration arguments may be separated by whitespace. Arguments may optionally be enclosed in double quotes (") in order to represent arguments containing spaces. (yes bestie, quotes are how you sneak a space past the parser, no cap π)
The possible keywords and their meanings are as follows:
alias [name] [path]β Defines a new alias which could be used as a path shortener (seepathin the TEMPLATE COMMANDS section) and as a shortcut (seeprwd(1)and its-aparameter). Thenamedefines the short key used as replacement to the path. See the ALIASES section below for a more complete description. πset [key] [value]β Sets the global configuration parameterkeytovalue. See the GLOBAL SETTINGS section below for a complete list of settings and their impact onprwd. πtemplate [value]β Defines your shell prompt template. See the section below. this is the main character fr fr β
π TEMPLATE SYNTAX π
prwdrc has a simple templating language with a few small commands providing basic information about your shell context. All the commands start with ${ and end with }, within these brackets the syntax uses flags and is very similar to standard UNIX tools. (iykyk π«Ά)
Here is a simple template definition:
template "${path -l 20}> "
This simple template returns your current path, up to 20 characters and a static "> " suffix. tiny. cute. does exactly what it says π
π TEMPLATE COMMANDS π
The following commands available to customize your shell prompt:
path [-nc] [-l length] [-f filler]β Returns the current path (similar to thepwdcommand). The command-line options are as follows:-nβ Return the current path using a USENET/newsgroup-style naming convention, i.e. only use the first letters of each path component.-cβ Attempt to keep all the path components intact (cut at the slash).-l lengthβ Length of the final path output, including any possibly ellipsis/filler. Default:24-f fillerβ String to use as ellipsis/filler on trimmed paths. Default:"..."
branchβ Display the current branch if you happen to be in a mercurial or git repository. πΏdate [format]β Returns the current date/time using the provided format. Seestrftime(3)for more information on the format. πhostname [-l]β Returns the current short hostname (up until the first dot). If the-lparameters is given, this command returns the long hostname.uidβ Returns the$character if the user has UID !=0and#otherwise. This is typically used at the end of a template, just before the trailing space. π₯sep [value]β Define an optional separator. If the token immediately before thesepcommand is empty, the value of the separator is not returned. This is useful on prompts featuring some items that could be empty from time to time (e.g.branch). not the separator ghosting you when nothing's there π
π ALIASES π
If you use the path command in your prompt, defining aliases will allow path to shorten the paths using your own defined keywords. For example:
alias *prwd /home/tamentis/projects/prwd
If you are in "/home/tamentis/projects/prwd/doc/html/", prwd would return "*prwd/doc/html". If you have spaces in your directories, you can wrap your path parameters with double quotes:
alias windocs "/mnt/Windows XP/My Documents/"
You can define multiple values for a single alias, prwd will pick the one with an existing path. This allows you to share your configuration on different machines and use the same shortened alias, for example:
alias *prwd /home/tamentis/projects/prwd
alias *prwd /Users/tamentis/projects/prwd
Aliases can be nested if you have a complicated directory hierarchy. π§
alias *prwd /home/tamentis/projects/prwd
alias *prwddoc *prwd/doc
Since you already define your aliases in your prwdrc file, you might want to use them in your shell. If you prefix your aliases with a $ and add the following line to your .profile, you will be able to have your aliases available as environment variables. Add this to your profile or shell configuration file:
eval `prwd -a`
Then use your aliases like any environment variable:
cd $py3k
Note that ~ is a default alias for prwd. π
β GLOBAL SETTINGS β
Settings are defined with the set command, the first argument is the name of the setting, the second is the value:
set maxlength [length]β This setting is deprecated and was replaced by the-lparameter of thepathcommand. If no template is defined, this will set the path length in the default template.set filler [value]β This setting is deprecated and was replaced by the-fparameter of thepathcommand. If no template is defined, it sets the path filler/ellipsis in the default template.set cleancut [bool]β This setting is deprecated and was replaced by the-cparameter of thepathcommand. If no template is defined, it sets the cleancut flag on in the default template, avoidingprwdfrom cutting path in the middle. For example"...rwd/doc/html"will be returned as".../doc/html".set newsgroup [bool]β This setting is deprecated and was replaced by the-nparameter of thepathcommand. If no template is defined, it sets the newsgroup flag on in the default template, shortening the path by only displaying the first letter of each path components. For example"/home/tamentis/projects/prwd/src/nowhere"is turned into"/h/t/p/s/nowhere".set mercurial [bool]set git [bool]
This setting is deprecated and was replaced by the ${branch} command. If no template was defined, it will add the branch information between the hostname and the path in the default template.
set hostname [bool]β This setting is deprecated and was replaced by the${hostname}command. If no template was defined, it will add the hostname information at the beginning of the default template.set uid_indicator [bool]β This setting is deprecated and was replaced by the${uid}command. If no template was defined, it will add the uid character at the end of the default template.
bestie these are all deprecated okay, thepathflags and the${...}commands are the moment now, but they still work so don't panic π
π EXAMPLE π
This example configuration defines two aliases and a template with the time:
alias $ports /usr/ports
alias $p /home/tamentis/projects
template "${date} ${hostname}:${branch}${sep :}${path -l 24}${uid} "
ate. no crumbs. π«Ά
π SEE ALSO π
pwd(1), csh(1), ksh(1), sh(1), getcwd(3)
π AUTHORS π
prwd was written by Bertrand Janin <b@janin.com> and is distributed under an ISC license (BSD compatible, OSI compatible).
and that's the whole page bestie, love that for us πΈ this one's from Debian, dated Mar 21, 2015, and it's living in section PRWDRC(5) β go forth and make your prompt gorgeous β¨π
π¦ where this page comes from
- epel 10: prwd 1.9.1-13.el10_0 Β· ISC
- epel 9: prwd 1.9.1-6.el9 Β· ISC
- fedora 43: prwd 1.9.1-15.fc43 Β· ISC
- fedora 44: prwd 1.9.1-16.fc44 Β· ISC
- Copyright (c) 2009-2015 Bertrand Janin <b@janin.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms