{"thread":{"id":"39922","subject":"Bash __git_ps1 line wrapping issue on OSX","startedAt":"2015-07-23T07:54:25Z","lastAt":"2015-07-23T07:54:25Z","messageCount":1,"participants":["Adam Moss"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"266650","messageId":"loom.20150723T095031-240@post.gmane.org","threadId":"39922","inReplyTo":null,"subject":"Bash __git_ps1 line wrapping issue on OSX","fromName":"Adam Moss","fromEmail":"admoss1980@btinternet.com","sentAt":"2015-07-23T07:54:25Z","receivedAt":"2015-07-23T07:54:25Z","isPatch":false,"sender":{"key":"admoss1980@btinternet.com","avatar":null},"body":"I have sourced git-prompt.sh (copied from\nhttps://github.com/git/git/tree/master/contrib/completion) and included it\nin my .bashrc as follows:\n\nGIT_PS1_SHOWDIRTYSTATE=true;\nGIT_PS1_SHOWUPSTREAM=\"verbose\";\nGIT_PS1_SHOWCOLORHINTS=true;\n\nPROMPT_COMMAND='__git_ps1 \"# \\u@\\h:\\w\" \" \\$ \"';\n\nUnder CentOS etc. this works fine. On OSX however, when dealing with a\nnested folder structure that causes line wrapping, the formatting of the bit\nwhere you type goes do-lally-tap.  Character spacing is wrong (like each\ncharacter is tab separated) and once it hits the end of the line it starts\nto overwrite itself (but only the last character).  There is a screen shot\nof the issue on the StackOverflow question I've asked about this at\nhttp://stackoverflow.com/questions/31561969/bash-git-ps1-line-wrapping-issue-on-osx.\n\nThe code that __git_ps1 has generated for PS1 is:\n\n# \\u@\\h:\\w (\\[\\e[32m\\]${__git_ps1_branch_name}\\[\\e[0m\\] \\[\\e[31m\\]*\\[\\e[0m\\]\nu=) $\n\nHas anyone experienced this and / or could suggest a solution?\n\nIf I comment out the GIT_PS1_SHOWCOLORHINTS directive it works, albeit\nwithout the colour highlighting, so I'm guessing there is something amiss in\nthe control sequences somewhere.\n\nThanks,\n\n\nAdam M.\n"}]}