my environment:
I install ranger through brew. I can't use alt-
I'm not familiar with iterm but on xterm there's the same issue and it can be fixed by setting xterm_alt_key to true, e.g. by adding this line at the end of ~/.config/ranger/rc.conf:
set xterm_alt_key true
Try it out and see if it works for you.
@hut thank you,but set xterm_alt_key true doesn't work to iterm2.
in iterm2,the solution is:

Most helpful comment
@hut thank you,but
set xterm_alt_key truedoesn't work to iterm2.in iterm2,the solution is: