Skip to content

custom PS1 template powerline #342

Answered by akinomyoga
oscarenzo asked this question in Q&A
Discussion options

You must be logged in to vote

It is defined in the following place:

function __powerline_cwd_prompt {
echo "$(pwd | sed "s|^${HOME}|~|")|${CWD_THEME_PROMPT_COLOR}"
}

Instead of directly editing the powerline theme file, you can define your own "segment" in .bashrc such as

# Your segment named "mycmd":
function __powerline_mycwd_prompt {
  echo "\w|${CWD_THEME_PROMPT_COLOR}"
}
POWERLINE_PROMPT="user_info scm python_venv ruby mycwd"

When you use the prompt escape sequence \w, you can control the number of directories shown by setting PROMPT_DIRTRIM. Note that this variable needs to be specified after source "$OSH/oh-my-ba…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@akinomyoga
Comment options

Answer selected by oscarenzo
Comment options

You must be logged in to vote
1 reply
@akinomyoga
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants