ParrotSec / parrot-core

Files to include in the package parrot-core.
41 stars 48 forks source link

Fixed PS1 inconsistency #5

Closed DanieleQ97 closed 5 years ago

DanieleQ97 commented 5 years ago

Removed \[\033[0;37m\] from every instance of PS1 in .bashrc See ParrotSec/parrot-core#4

DanieleQ97 commented 5 years ago

Now that I've read the whole string more slowly I can see why that wrong color instruction, \[\033[0;37m], was there: It was meant to be a \[\033[0;31m] and was there to reset the color back to the base one of the shell prompt after the red "failed-check" character is printed out. Interestingly enough, the base color of the shell prompt (\[\033[0;31m]) is the same red used for the "failed-check" character. So, with the current setup, both the \[\033[0;31m] that precedes the "failed-check" character and the \[\033[0;37m] (that was meant to be a \[\033[0;31m]) that follow it turn out to be unnecessary and can be removed. That said, while unnecessary for the code to produce the desired effect, they can be useful to improve a bit the readability of the PS1 string (which is already, by itself, ancient aramaic). Especially if, in future, someone'll want to change the shell prompt base color with something else while keeping the "failed-check" character red, e.g. to do something like this: Test