1

I've seen dozens of articles that talk about making terminal life better by switching to iTerm2 and then turning on "Natural Text Editing" under Profile > Keys. Then you can use the normal option+left/right to move between words.

I have tried that, and it works.. One time. I can jump back exactly one word, and then I just get a bell any time I try moving left or right with option. If I hit enter, the command works as expected. And at the next prompt I'm allowed to cursor over one word and then it stops again.

I have tried the same in the default Terminal app and get the same results. I can move one word, and then bells.

In playing around with the keys, after option+left arrow the one time, I can still move around normally with the left and right cursor arrows. But I seem to be in some weird vim-like shortcut mode as hitting b moves me back and w moves me forward. Typing v puts me in a vim-like editor (:q to get back to the command prompt.

This is on a brand new M1 Macbook Pro, v12.1, using bash if it makes a difference.

2 Answers 2

2

I found my problem.

Deep in the recesses of my .bash_profile was the command

set -o vi

Which effectively made my prompt work like vi after it detected the ESC character from going back a word. After I removed the line, things work like I expected.

0

I faced a similar problem with oh my zsh and the zsh-vi-mode plugin enabled. After disabling the plugin, Natural Text Editing works just fine.

You must log in to answer this question.

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