Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Hello I am trying to go begining of the line. neither left arrow key or ctrl + a lets me do it. everytime it keeps couple letters on the right. however its a visual bug my cursor is actually in the begining

I am not exactly sure why it happens but it happen both on default terminal app and iterm2

enter image description here

enter image description here

P.S : it isnt only happens with this command I just didnt know what else to write to show.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

That issue is related to your $PS1, you're probably missing some escape character. This one should work:

PS1="\[\e[1;31m\]\u[\w]$\[\e[0m\] "

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.