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

In Terminal, Option + click allows me to place my cursor at any point on the current line-- great for editing really long commands.

How can I do this in iTerm2?

Update: According to this page, the feature has been around since 0.7.0 (2003). I've also noticed that if I hold Command+Option, the cursor changes into the familiar cross like in Terminal... but clicking still does not reposition my cursor.

share|improve this question
I had a look at the source code and yes the feature was around in 0.7.0 of iTerm (not iTerm2). But is commented out (in file PTYSession.m) in the trunk (and probably earlier versions too). And it iTerm2 the function is still there but empty and therefore doesn't do anything. – boretom Mar 10 '12 at 23:46
up vote 5 down vote accepted

I was wondering "How Hard Can It Be(c)" to implement it and gave it a go today.

The seems to emulate 'move cursor to left/right' ESC sequences. You'll hear the famous 'beep' if you try to place the cursor in the shell prompt. And you'll hear it as many times as there are invalid moves.

The solution in iTerm2 works the same by invoking the appropriate ESC sequences. Although it beeps only once if you try to place the cursor in an invalid area ;) seems not to be able to handle multi-line prompts, only moving on the last line seems to work. Multi-line prompts in this implementation should be handled correct.

Results can be found on github. It's a fork of the original with a pending pull request. The branch I work on is named 'option-click-hardcoded'.

And of course it's highly untested. That means tested only by me on my late-2007 MacBook Pro running Mac OS X 10.7.3.

If you'd like try it out by compiling it yourself or download the precompiled binary for i386/x86_64/ppc

share|improve this answer
wow, great stuff! pre-compiled binary seems to work fine on my end so far but will keep an eye on it. thanks a million! – Jeff Mar 11 '12 at 22:58

iTerm 2 is not a new version of iTerm - while based on the same source code, there are major changes under the hood. One of the things that was removed or broken (hard to speak to the developer's intent) was cursor positioning.

You're not the only one who noticed this omission; it's been filed as a bug since April 2011 and continues to attract attention. Your best option for getting this feature (besides forking it on GitHub or switching to another application) is to submit a comment at the Google Code site above. Hopefully with enough interest, this feature will make it back into the product.

share|improve this answer

The latest builds now include this feature, as of March 15 2012.

Official Download site:

The latest build (Currently March 26th 2012) includes this feature.

share|improve this answer
thanks for the update! – Jeff Jun 1 '12 at 14:19

This is no longer working in the latest build, you'll have to go back to

as mentioned in the original ticket that got the feature added:

share|improve this answer

The latest version of iterm2 (I'm using Build 2.9.20150812-nightly) has this feature, but in order for it to work with multiple lines you have to enable shell integration as described at

To install the latest iTerm, I use brew and execute the following:

brew tap caskroom/versions && brew cask install iterm2-nightly

share|improve this answer

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.