1

[I AM KING OF PROMPT (aka: solved)] Some fancy bash prompt magic

view story
linux-howto

https://bbs.archlinux.org – LADIES AND GENTELMEN!After 4 hours, 3 breaks, 2 rage-quits, HUNDREDS of screw ups, lunch, and a tiny bit of crying, I present to you my finished bash script:PROMPT_COMMAND=" #LastCommand=\$(fc -nl -1) function FixPath() { local MyName='/u/'\$USER local TempPath='('\$PWD')' local Abc='~' Path=\${TempPath/\$MyName/\$Abc} PathWidth=\$[\${#Path} + 2] if [ \$[\$PathWidth > \$[ \${COLUMNS} / 2 ]] == '1' ] then local StartPos=\$[\$PathWidth - \${COLUMNS} + 4] local TempPath=\${Path:\$StartPos} Path='(...'\ (HowTos)