P is a tool to change PS1
quickly. It's designed for bash and zsh.
$ sudo make install
$ \p --patch
Then, start a new bash/zsh and run p
:
\p --patch
will append configurations into ~/.bashrc
and ~/.zshrc
.
For ~/.bashrc
, the configuration is:
## config for p
alias p="p `basename $(ps -p$$ -o cmd=)` && source $HOME/.p"
## end
For ~/.zshrc
, the configuration is:
## config for p
autoload -U colors && colors
alias p="p `basename $(ps -p$$ -o cmd=)` && source $HOME/.p"
## end
p
by default is installed to /usr/local/bin.
Currently, p
is implemented by Python. A version by Shell is in the development. Other programming languages will be used to implement p
, but the timing is not clear.
Color Bash Prompt - Archlinux wiki
How can I change the color of my prompt in zsh?
ANSI escape code - wikipedia
How do I get a single keypress at a time? - python docs
Terminal control/Preserve screen
Python method for reading keypress?
nodejs how to read keystrokes from stdin
How to capture the arrow keys in node.js
MIT