4

I changed my job and now I have a Macbook for working I configured Iterm2 with zsh and almost everything is working, but certain shortcuts aren't, one of the most used by me every day "alt+backspace" to delete a word before a special character appears, I tried a lot of things with the Hexa code an so on, in most cases it is almost working, but it deletes the entire line

Example :

ls /tmp/file1

With alt+ backspace this will delete the complete text /tmp/file1 while on Linux it will just delete file1

Is there some way to configure Iterm2 to have the same behaviour than in Linux for this shortcut ?

I tried things like this

https://jorge.fbarr.net/2018/06/08/iterm-and-altbackspace/

But it's not working as in Linux.

user2275908
  • 137
  • 2
  • 9
  • 1
    [so] is for programming questions, not questions about using or configuring Unix and its utilities. [unix.se] or [su] would be better places for questions like this. – Barmar Jul 19 '21 at 15:11
  • Are you using `zsh` in Linux? Pretty sure this is a `bash`-vs-`zsh` issue, not related to iTerm2 or your MacBook. – chepner Jul 19 '21 at 21:26
  • Hi @chepner yeah, I installed zsh using brew, in my personal computer I have zsh also, and almost the same config but I can't make it work, have you some clue ? – user2275908 Jul 19 '21 at 22:38
  • Not sure. I think it has something to do with how Readline and zle define a "word", but I don't think I've ever bothered looking into how you change either library's definition. – chepner Jul 19 '21 at 22:45
  • Q is related to ITerm, becase other terminall does not block ALT+BS, or OPT+BS. – kyb Feb 02 '23 at 21:45

1 Answers1

1

This is what helped me. Option key should send ESC+ sequences and all will work fine.

enter image description here

And I have no idea what is "normal"

kyb
  • 7,233
  • 5
  • 52
  • 105