Prompt for zsh that displays the current tctx context.
zsh's robbyrussell theme
p10k theme
This will add the tctx context to the right of your prompt.
-
Clone this repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
)git clone https://github.com/sikian/zsh-tctx ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-tctx
-
Add the plugin to the list of plugins for Oh My Zsh to load (inside
~/.zshrc
):plugins=( # other plugins... zsh-tctx )
-
Start a new terminal session.
If you're using powerlevel10k (highly recommended!), you can extend it with the tctx prompt as follows.
-
Clone this repository
git clone https://github.com/sikian/zsh-tctx ~/.zsh/zsh-tctx
-
Add the prompt to your
~/.p10k.zsh
.a. Add
tctx
to whicheverPROMPT_ELEMENTS
you prefer. Example:typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( # =========================[ Line #1 ]========================= os_icon dir vcs tctx # tctx prompt! # =========================[ Line #2 ]========================= newline prompt_char )
b. Search for
POWERLEVEL9K_EXAMPLE_BACKGROUND
and source$HOME/.zsh/zsh-tctx/p10k-tctx.zsh
after:... typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 # Source tctx prompt function source $HOME/.zsh/zsh-tctx/p10k-tctx.zsh ...
-
Start a new terminal session.
-
Clone this repository somewhere on your machine. This guide will assume
~/.zsh/zsh-tctx
.git clone https://github.com/sikian/zsh-tctx ~/.zsh/zsh-tctx
-
Add the following to your
.zshrc
:source ~/.zsh/zsh-tctx/zsh-tctx.zsh
-
Start a new terminal session.
If you'd rather have other colours, you can either change the source code or
just change the following env vars in your ~/.profile
or ~/.zshrc
to whatever suits you best:
export ZSH_TCTX_PROMPT_BACKGROUND=
export ZSH_TCTX_PROMPT_PREFIX=
export ZSH_TCTX_PROMPT_PREFIX_FOREGROUND=
export ZSH_TCTX_PROMPT_PROD_FOREGROUND=
export ZSH_TCTX_PROMPT_DEFAULT_FOREGROUND=
For a list of colors, run in your terminal:
for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done
Current defaults:
export ZSH_TCTX_PROMPT_BACKGROUND=
export ZSH_TCTX_PROMPT_PREFIX=tctx
export ZSH_TCTX_PROMPT_PREFIX_FOREGROUND=255
export ZSH_TCTX_PROMPT_PROD_FOREGROUND=009
export ZSH_TCTX_PROMPT_DEFAULT_FOREGROUND=005