custom PS1 template powerline #342
-
Hello, I would like to know how can to customize the variable PS1 that by default show my prompt:
It is:
The problem in this case is when you are in directory very nested the prompt can be very large:
--
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It is defined in the following place: oh-my-bash/themes/powerline/powerline.base.sh Lines 92 to 94 in 1272a39 Instead of directly editing the # 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 |
Beta Was this translation helpful? Give feedback.
-
@akinomyoga thank you very much, I'm deleted my first comment by it was wrong, I forget the function, now it works, this is the result:
Thank you very much again!, doubt solved :) NOTE: Finally my config look like this:
|
Beta Was this translation helpful? Give feedback.
It is defined in the following place:
oh-my-bash/themes/powerline/powerline.base.sh
Lines 92 to 94 in 1272a39
Instead of directly editing the
powerline
theme file, you can define your own "segment" in.bashrc
such asWhen you use the prompt escape sequence
\w
, you can control the number of directories shown by settingPROMPT_DIRTRIM
. Note that this variable needs to be specified aftersource "$OSH/oh-my-ba…