0

In Linux this can be done by something like:

alias cdwww="cd /srv/www"

In Windows there is an equivalent command called DOSKEY, used for example like this:

doskey ls=dir $*

The above works perfectly in Windows' built-in CMD but not in Emacs shell. Emacs simply ignores it and throws an error:

'ls' is not recognized as an internal or external command, operable program or batch file

Any idea how to create aliases in Emacs for Windows?

NickD
  • 27,023
  • 3
  • 23
  • 42
W.M.
  • 113
  • 3
  • 1
    Arguably, if you start creating aliases resembling Unix commands, it may be easier for you to just install bash and co through Cygwin. – Hi-Angel Aug 05 '21 at 21:05
  • @Hi-Angel, thank you that is indeed the best way to go. I have installed `Cgwin` and ran `Emacs` but I have a strange issue: every time I hit `enter` in shell I get a line like this: `^[]0;~^G`, what is that? How to get rid of it? – W.M. Aug 05 '21 at 21:32
  • Hmm, sorry, not sure what could that be… While searching around I see that [apparently lots of people successfully use Emacs + Cygwin combination](https://stackoverflow.com/questions/235254/how-can-i-run-cygwin-bash-shell-from-within-emacs), so offhand no idea why could that be happening for you. – Hi-Angel Aug 05 '21 at 21:40
  • If you have Windows 10, I can recommend WSL (you may have considered and rejected this already). In Cygwin, what do you see when you "echo $PROMPT"? If you get that everytime you hit enter, it may be a prompt with some escape codes embedded. – Mark Dunne Aug 05 '21 at 23:13

0 Answers0