twolfson / sexy-bash-prompt

Bash prompt with colors, git statuses, and git branches.
MIT License
1.14k stars 154 forks source link

Not change the PS1 #60

Closed Mte90 closed 8 years ago

Mte90 commented 8 years ago

Is possible to not change the PS1 output of the shell? in my case is: mte90@siduction:~$ but with that became #

twolfson commented 8 years ago

Unfortunately, the prompt operates by overriding PS1. It's unclear but did you want help debugging or uninstalling sexy-bash-prompt?

Mte90 commented 8 years ago

Only how to change the code so the PS1 remain like the original but only the git commands will be colorful.

twolfson commented 8 years ago

I still don't understand. What do you mean by "the original" and "git commands will be colorful"? Can you provide examples?

Mte90 commented 8 years ago

With that software I get

root at siduction in /tmp
# quit

but the original on my system is

root@siduction:/tmp#
twolfson commented 8 years ago

Ah, I see so you want the coloring but not the "at"/"in"/multiline format.

twolfson commented 8 years ago

I can think of 2 options:

Mte90 commented 8 years ago

Ok thanks for the info. In my case is '${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

Mte90 commented 8 years ago
PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\$( sexy_bash_prompt_is_on_git && \
  echo -n \" \[$sexy_bash_prompt_preposition_color\]on\[$sexy_bash_prompt_reset\] \" && \
  echo -n \"\[$sexy_bash_prompt_git_status_color\]\$(sexy_bash_prompt_get_git_info)\" && \
  echo -n \"\[$sexy_bash_prompt_git_progress_color\]\$(sexy_bash_prompt_get_git_progress)\" && \
  echo -n \"\[$sexy_bash_prompt_preposition_color\]\")\[$sexy_bash_prompt_reset\]\
\[$sexy_bash_prompt_symbol_color\]$sexy_bash_prompt_symbol \[$sexy_bash_prompt_reset\]"

Ok now i have changed in that way and is perfect for my needs.

twolfson commented 8 years ago

Wonderful, I'm glad to hear it all worked out. Thanks for posting your result so others can reuse it =)