letiantian / p

PS1 management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

p

P is a tool to change PS1 quickly. It's designed for bash and zsh.

Installation

$ sudo make install
$ \p --patch

Then, start a new bash/zsh and run p:

Details

\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.

Reference

n

Color Bash Prompt - Archlinux wiki

Zsh - Archlinux wiki

Zsh/Guide - gentoo 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

License

MIT

About

PS1 management


Languages

Language:Python 69.6%Language:Shell 29.8%Language:Makefile 0.6%