Shell Prompt Line Wrapping Issue

前端 未结 9 1948
一生所求
一生所求 2021-01-30 03:30

I\'ve done something to break my Bash Shell Prompt in OS X (10.5.7) Terminal.

This is the PS1 that I had configured:

PS1=\'\\[\\e[1;32m\\]\\h\\[\\e[0m\\]         


        
9条回答
  •  失恋的感觉
    2021-01-30 03:56

    Line wrapping issues in Bash are nothing new. Your PS1 should work as is but there is a bug in Bash 3.2.49. Consult the mailing list, there's yet another bug regarding this which was confirmed to be fixed in 4.0.

    You can't do much more than tagging unprintable characters with \[ and \], the rest must be done by the prompting code.

提交回复
热议问题