How to color a prompt on FreeBSD/cshrc?

后端 未结 3 1586
[愿得一人]
[愿得一人] 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 13:47

    # Add these lines to your ~/.cshrc.mine file on the linux grace machines...
    
    # Colors!
    set     red="%{\033[1;31m%}"
    set   green="%{\033[0;32m%}"
    set  yellow="%{\033[1;33m%}"
    set    blue="%{\033[1;34m%}"
    set magenta="%{\033[1;35m%}"
    set    cyan="%{\033[1;36m%}"
    set   white="%{\033[0;37m%}"
    set     end="%{\033[0m%}" # This is needed at the end... :(
    
    # Setting the actual prompt
    
    set prompt="${green}%n${blue}@%m ${white}%~ ${green}%%${end} "
    
    # Clean up
    unset red green yellow blue magenta cyan yellow white end
    

提交回复
热议问题