7

In iTerm2, if I type /one/two/three/four/five and now if I want to delete five and write another string, then how do I delete the word five ?

If I use CTRL + W, it deletes the entire command all the way up to the beginning forward slash.

This exact same functionality is available on the out-of-the-box Terminal using option + BACKSPACE by using option key as meta key. I am running bash, but this terminal keyboard combination is not working on iTerm2.

3
  • Your answer should be posted as an answer below! Questions are for asking questions
    – grg
    Commented Feb 21, 2018 at 9:16
  • 2
    I can't replicate the problem. On a pretty "clean slate" macOS install, Ctrl-W in iTerm deletes the word. (Clean slate meaning other than iTerm, Firefox, and Chrome nothing else has been installed). Did you customize anything in iTerm?
    – Allan
    Commented Feb 21, 2018 at 11:33
  • "In iTerm" is a nonsense statement, iTerm doesn't delete anything, the line editor of the shell you are running deletes things. All iTerm does (or doesn't do) is mangle what you type in interesting ways before it is presented to the line editor. Commented Aug 13 at 23:08

1 Answer 1

5

I just found that in iTerm2, set options key as ESC+ key under profile -> keys.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .