Re:Customizing Your Shell
by bewuethr on Friday April 17, 2020 @11:19AM
(#22899760)
Not trying to extract the bad parts here – this looks like a lot of effort went into it and it certainly is useful – but there are a few wrinkles:
[[ $? ]]
is always true, even if $? is non-zero; it only checks if $? is non-empty. A working check for successful exit status would be (for Bash)
if (($?)); then
echo "not successful"
else
echo "succesful"
fi
For prompt configurations: the article hardcodes the "$" sign. A useful feature is to indicate when the user is root by switching to "#"; this can be achieved by escaping the "$".
The colour section doesn't mention true colour support; many terminal emulator come with it these days, see https://gist.github.com/XVilka/8346728.