msys – tput 함수 구현
2015-05-21
msys2에는.. tput이 있으나.. msys에는 없다..
아래와 같이.. /etc/proflile 파일에 넣어두고..
if ! which tput 2> /dev/null ; then tput () { case "$1" in bold) echo -ne "\033[1m" ;; setaf) echo -ne "\033[0;3$2m" ;; sgr0) echo -ne "\033(\033[m" ;; esac } fi
아래와 같이 프롬프트를 셋팅해본다..
export PS1="\[\e]0;$(gcc -dumpmachine) $(gcc -dumpversion) : \w\a\]\n\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
아래와 같이 나온다..
Categorized as: Application | Programming
답글 남기기