I changed laptop and I cannot configure my Terminal the way it was.

I had this shortcut to delete words, and when deleting ab-cd.ef_gh, it would go ab-cd.ef_ then ab-cd. then ab- then nothing. So it would break on hyphens and on other such characters. But the behaviour now is to delete the full sequence ab-cd.ef_gh instead of doing it "one by one". How can I do that?

  • Just for clarity - deletion used to delete “-gh” and not “gh”? In another words break was after “-“. Dec 23, 2020 at 23:32
  • @AivarPaalberg I don't remember well but I think you are right, let me edit. Also it was any punctuation
    – Thomas
    Dec 24, 2020 at 6:51

1 Answer 1


I found an answer on Super user

The issue was that Mac went from bash to zsh. There is nothing about a shortcut to "delete part of a word". The solution is to use the common "delete word" shortcut and define what a word is: bash defines a word to be a-zA-Z0-9 but not zsh which defines words as anything in between spaces (so ab.cd or /ef/gh/ij).

for the sake of completeness, add to your .zshrc:

autoload -U select-word-style
select-word-style bash

You must log in to answer this question.

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