[Terminal] Shorten cwd on your terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Styling Terminal | |
export ELIS_PATH='$(pwd|awk -F/ -v "n=$(tput cols)" -v "h=^$HOME" '\''{sub(h,"~");n=0.1*n;b=$1"/"$2} length($0)<=n || NF==3 {print;next;} NF>3{b=b"/.../"; e=$NF; n-=length(b $NF); for (i=NF-1;i>3 && n>length(e)+1;i--) e=$i"/"e;} {print b e;}'\'')' | |
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[35m\]\h:\[\033[33;1m\]$ELIS_PATH\[\033[m\]\$\[\033[m\] " |
댓글
댓글 쓰기