.bash_prompt | terminal prompt that shows : virtualenv name | Command Line Interface library
kandi X-RAY | .bash_prompt Summary
kandi X-RAY | .bash_prompt Summary
The terminal prompt that shows: virtualenv name, git branch, and whether git is dirty.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of .bash_prompt
.bash_prompt Key Features
.bash_prompt Examples and Code Snippets
Community Discussions
Trending Discussions on .bash_prompt
QUESTION
I wrote a Python script to replace "powerline" as a terminal prompt solution for myself here: https://github.com/diogobaeder/dotfiles/blob/master/.bash_prompt.py
Then all I do is to define the prompt from the output of that script:
...ANSWER
Answered 2018-Aug-18 at 04:15Bash first interprets the escape sequences in $PS1
and only afterwards handles command substitution, etc.
Bash allows these prompt strings to be customized by inserting a number of backslash-escaped special characters that are decoded as follows [...] After the string is decoded, it is expanded via parameter expansion, command substitution, arithmetic expansion, and quote removal [...]
--Bash Reference Manual: Controlling the Prompt
This means that any special sequences printed by your command will not be interpreted as colors, etc. The solution is to use $PROMPT_COMMAND
to change the value of $PS1
, like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install .bash_prompt
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page