[PATCH] generic: Colorize the command line prompt

Ted Hess thess at kitschensync.net
Wed May 4 12:04:53 PDT 2016


> This patch colorizes the command line prompt 
> 
> Signed-off-by: L. D. Pinney <ldpinney at gmail.com>
> ---
> 
> package/base-files/files/etc/profile | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/package/base-files/files/etc/profile b/package/base
> -files/files/etc/profile
> index ad8fe12..ccceb2f 100644
> --- a/package/base-files/files/etc/profile
> +++ b/package/base-files/files/etc/profile
> @@ -9,7 +9,13 @@ fgrep -sq '/ overlay ro,' /proc/mounts && {
>  export PATH="%PATH%"
>  export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
>  export HOME=${HOME:-/root}
> -export PS1='\u@\h:\w\$ '
> +#export PS1='\u@\h:\w\$ '
> +export PS1='\t
> [\[\033[31;1m\]\u\[\033[0m\]@\[\033[32;1m\]\h\[\033\[0m\]:\[\033[33;1m\]$PWD\[
> \033[0m\]]\$ '
> +
> +### COLORS ###
> +# 31 = red ; 32 = green ; 33 = yellow ; 34 = blue ; 35 = magenta ; 36 = cyan
> ; 37 = white ; 38 = black
> +
> +
>  
>  [ -x /bin/more ] || alias more=less
>  [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi

This would be nice if everyone liked colorized prompts. Could you do this as a
configuration (UCI/system?) option with the default as it is now (off).

Please don't force personal stylistic preferences on everyone.

/ted



More information about the Lede-dev mailing list