Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
A screenshot could be helpful. You could use for it. – Desmond Hume Feb 22 '13 at 14:55
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

Your Answer


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.