In Emacs shell, is there a command similar to M-p but which would skip repeated commands? That is, it would go to the next different command. Similar to regular Linux terminal.
So if I were to run:
ls ./script ./script ./script make
and press M-p three times, I want it to go to ls command.
Or, alternatively, how can I define a command like this?