How to color a prompt on FreeBSD/cshrc?

后端 未结 3 1589
[愿得一人]
[愿得一人] 2021-02-03 13:34

I\'m being put in charge of managing a bunch of servers, I want to set up my prompts on each of them so that I don\'t get confused as to where I am logged in to.

I\'ve e

3条回答
  •  面向向阳花
    2021-02-03 14:04

    To my knowledge FreeBSD comes with tcsh by default. Have a look at the examples.

    Another list for other shells as well (bash, csh, tcsh, ksh, etc.) is available. Taken from that link and tested with tcsh (I do not have csh installed):

    To color the prompt you will want to place this symbol in your prompt. %{\033[Xm%}.

    Certain colors need a semicolon in order to appear. Yellow […] is 1;33 do not use just 33 or it will come out brown. If you have a 0;31 you don't need to place the 0.

    The colours are ANSI. Have a look at the ANSI colours list; simply replace X with the colour code.

    X = 0 resets the colours: %{\033[0m%}.

提交回复
热议问题