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.

When I start terminal the cursor position is 1 position righter then it should be and there is a gap between last symbol and the cursor.

How can I fix it?

share|improve this question
2  
A screenshot could be helpful. You could use tinypic.com for it. –  Desmond Hume Feb 22 '13 at 14:55
add comment

1 Answer 1

up vote 1 down vote accepted

"1 position righter then it should be" is a matter of opinion :-) I believe the cursor is right where it should be. But either way, this is determined by the PS1 environment variable (assuming you're using the default bash shell)

You'll want to set PS1 to not have a training space on the end of it. The exact command will depend on what your PS1 is currently. The following should get you there:

echo $PS1

Will show you what PS1 currently is. Copy that value, then execute:

export PS1="<paste value>"

Pasting the value you copied in place of <paste value>. Be sure to not have a training space. So in my case, I did:

export PS1="\h:\W \u\$"

To make this stick, add the export PS1 line to your .bashrc file with a text editor.

share|improve this answer
    
Thank you very much. It solves the problem) –  Nikita Feb 22 '13 at 17:20
    
Glad I could help! –  Josh Feb 22 '13 at 18:13
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.