Join the community today
Register Now

Beta Branch customise PS1 command prompt for clearer identification of server

Discussion in 'Centmin Mod Github Commits' started by eva2000, Feb 2, 2017.

Tags:
  1. pamamolf

    pamamolf Premium Member Premium Member

    3,885
    381
    83
    May 31, 2014
    Ratings:
    +741
    Local Time:
    11:29 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    Ok updated and checked again and now i can see only the working directory and not the full path of it..... :)

    In my opinion is not so useful and i don't like it but ok no problem :)

    But the hostname there is very good !
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:29 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yeah hope it prevents froms from running commands on the wrong server like this gitlab employee did on production server instead of staging GitLab employee ran rm -rf on production !
     
  3. pamamolf

    pamamolf Premium Member Premium Member

    3,885
    381
    83
    May 31, 2014
    Ratings:
    +741
    Local Time:
    11:29 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    How can i adjust the command if i want to not have there the working directory?
     
  4. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:29 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    post #19 already mentions it the default is having working directory basename now not full name

    i wouldn't recommend totally removing basename of work directory
     
  5. Sunka

    Sunka Well-Known Member

    1,142
    313
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +510
    Local Time:
    10:29 PM
    Nginx 1.17.9
    MariaDB 10.3.22
    Found solution.
    In above code somewhere is enclosed bracket, but can not found where so bash thinks that line is not how log it should be... blah blah.. on longer commands there is no line wrap but command try to write on same line on beginning...

    This is the correct code for above uncorrect code:
    Code (Text):
    export PS1="\[$(tput setaf 7)\]\[$(tput setaf 2)\][\u@\h \W]\\$ \[$(tput sgr0)\]"
     
  6. RB1

    RB1 Active Member

    285
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    1:29 PM
    Nginx 1.18.x
    MariaDB 10.1.x
    Hmm...this would be good if they made computer monitors in 8640x200 pixels :D:LOL::ROFLMAO:
     
  7. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:29 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    nice work (y)

    heh .. that was on my 1920x1200 monitor :)