이런 거지같은 경우가 다 있나.
일단 커스텀 코드는 이거
export PS1='\[\e[36m\]\u@\h\[\]\e[37m:\e[33m\w\e[0m\$ '
문자열 자체를 \[ 와 \]로 감싸줘야한다고 한다.
https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
역시 뭘 할때는 공식 문서를 잘 참조하자
- \[ : begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
- \] : end a sequence of non-printing characters
수정한 코드는 이것
export PS1='\[\e[36m\]\u@\h\[\e[37m:\e[33m\w\e[0m\$ \]'
완전히 문제가 해결되었다고 보기는 애매하지만 적어도 프롬프트가 사라지는 기현상은 일어나지 않는다.
댓글