Skip to content

These docs are for the newly-released v4.

If you are or were using v3, check out What's New. If you are or were using v3 and do advanced configuration, read the migration guide and/or read about pinning v3.x.

 

 

Interactive Demo & Configurator

On this page you can see how Hometown Prompt responds to context (user, host, Git status, etc).

You can also experiment with customizing your configuration.

TIP

No custom configuration is required. Hometown Prompt works right out of the box.

Custom content and the prompt character are printed with prompt expansion, with PROMPT_SUBST and PROMPT_PERCENT. For example, the default prompt char %% is rendered as %, and the default custom content %* is rendered as the 24-hour HH:MM:SS time.

olets@dev
11:31:05
olets/hometown-prompt
main
??UU_D_MA_D_M_
%

Custom configuration ready for copying and pasting into your .zshrc:

(see Options)

Context

Terminal

ContextValue

User

ContextValue

Session

ContextValue

Directory

ContextValue

Git ref

Context Notes Value
Only relevant when on a branch
Only relevant when on a branch
Only relevant when on a branch
Only relevant when on a branch with a remote
Only relevant when on a branch with a remote

Triangular workflow

Context Notes Value
Only relevant when on a branch
Only relevant when on a branch with a distinct push remote
Only relevant when on a branch with a distinct push remote
Only relevant when on a branch with a distinct push remote

Git status

ContextValue

Extended Git status

ContextValue

Options

Hometown Prompt Configuration

For detailed documentation of these options, see the Options page.

Content Options

See Options > Content for details.

OptionDefaultTypeNotesValue
'%*'stringIn the terminal, this is printed with prompt expansion with PROMPT_SUBST and PROMPT_PERCENT
1integer
1integerSets psvar to ( <time> <exit code-dependent color> <char> <date> <whether date is different from today> ). Used by the default HOMETOWN_TRANSIENT_PROMPT_ENV and scheduled refresh.

Layout Options

See Options > Layout for details.

OptionDefaultTypeNotesValue
1integer
1integerSee also Advanced.
1integerSee also Advanced.
1integer

Scheduled refresh

See Options > Scheduled refresh for details.

OptionDefaultTypeValue
(( HOMETOWN_SET_PSVAR && ! psvar[5] )) && _hometown_set_date_psvar; _git_prompt_kit_update_gitfunction
0integer

Transient Prompt Options

See Options > Layout for details.

OptionDefaultTypeNotesValue
( [GIT_PROMPT_KIT_CWD_MAX_TRAILING_COUNT]-0 [GIT_PROMPT_KIT_HIDE_INACTIVE_AHEAD_BEHIND]-1 [GIT_PROMPT_KIT_HIDE_INACTIVE_EXTENDED_STATUS]-1 [GIT_PROMPT_KIT_HIDE_TOOL_NAMES]-1 [GIT_PROMPT_KIT_SHOW_INACTIVE_STATUS]-0 [GIT_PROMPT_KIT_SYMBOL_CHAR_NORMAL]-$' ' [GIT_PROMPT_KIT_SYMBOL_CHAR_ROOT]-$' ' [HOMETOWN_CUSTOM]-'%F{%2v}%3v%f %(5V.%5v %v - %W %*.%v-%*)' [HOMETOWN_LINEBREAK_AFTER_GIT_REF]-0 [HOMETOWN_LINEBREAK_BEFORE_PROMPT]-0 [HOMETOWN_NO_LINEBREAK_BEFORE_GIT_REF]-1 )associative arrayDefault value assumes HOMETOWN_SET_PSVAR is non-zero.
1integer

* Git ref info is branch or commit, ahead/behind counts, remote name(s), and tag. See the GIT_PROMPT_KIT_REF docs.

Git Prompt Kit Configuration

Hometown Prompt is made almost entirely of Git Prompt Kit components. So almost all of configuration —color customization, symbol customization, dimming vs hiding inactive elements, the number of path segments shows, etc— is done by configuring through Git Prompt Kit. (Git Prompt Kit is bundled with Hometown Prompt, so no additional download is necessary.) For detailed documentations of these options, see the Git Prompt Kit’s options documentation.

Behavior Options

See Git Prompt Kit’s options’ documentation for details.

OptionDefaultTypeValue
1integer
1integer
1integer
1integer

Color Options

See Git Prompt Kit’s options’ documentation for details.

OptionDefaultTypeNotesValue
199colorANSI or hex
81colorANSI or hex
39colorANSI or hex
88colorANSI or hex
140colorANSI or hex
109colorANSI or hex
247colorANSI or hex
111colorANSI or hex
216colorANSI or hex
81colorANSI or hex
120colorANSI or hex
81colorANSI or hex
76colorANSI or hex
86colorANSI or hex
162colorANSI or hex
109colorANSI or hex

Content Options

See Git Prompt Kit’s options’ documentation for details.

OptionDefaultTypeNotesValue
1integer
upstreamstring
originstring
()arrayMust be in parentheses
Must match /\(.*\)/
()arrayMust be in parentheses
Must match /\(.*\)/
1integer
0integer

Symbol Options

See Git Prompt Kit’s options’ documentation for details.

OptionDefaultVerbose DefaultTypeNotesValue
+ahead string
ahead
assumed-unchangedstring
assumed-unchanged
-behind string
behind
branch: string
$'\n%% 'stringRendered as a prompt string. The default renders as %
$'\n# 'string
commit: string
UU conflictedstring
conflicted
_D deletedstring
deleted
D_ staged-deletedstring
staged-deleted
@ host: string
localstring
_M modifiedstring
modified
M_ modified-stagedstring
modified-staged
A_ newstring
new
@{push}push remote: string
@{u}remote: string
skip-worktreestring
skip-worktree
stashesstring
stashes
@tag: string
?? untrackedstring
untracked
**The default if GIT_PROMPT_KIT_VERBOSE_DEFAULT_SYMBOLS is non-zero.