4 ms·
Ctrl-D for REPLs always bites me with GHCi. My usual approach to quitting GHCi is: - Press Ctrl-D, like normal - Get confused when nothing happens - Remember
by chriswarbo 2y ago
Ctrl-D for REPLs always bites me with GHCi. My usual approach to quitting GHCi is:
- Press Ctrl-D, like normal
- Get confused when nothing happens
- Remember that it doesn't work in GHCi, so run `:q` instead
- Get an error message about "lexical error at character '\EOT'", due to Ctrl-D inserting an invisible char at the start of the input
- Try `:q` again, without any invisible prefix
- GHCi successfully quits
- jeffrallen 2y agoYou think that's hard, try getting out of vi when you're on a keyboard from an unfamiliar country.
- lilyball 2y agoDo keyboards in unfamiliar countries not have the colon key?
- WolfeReader 2y agoThat or the Q key
- Philpax 2y agoBoth the colon and Q keys can be in different places, which can really mess with your muscle memory.
- from-nibly 2y agoOr if you are like me and have caps mapped as escape. Vim works really weird when you start typing random capital letters after thinking you were moving somewhere.
- saint_yossarian 2y agoThere's also the `ZZ` / `ZQ` alternatives, so you just have to find those letters :)
- linhns 2y agoThere's this: https://github.com/hakluke/how-to-exit-vim https://github.com/hakluke/how-to-exit-vim
- soraminazuki 2y agoVim tells you how to quit when you press ctrl-c. It even tells you how to quit the moment you launch it. The meme about how impossible it is to quit Vim is nonsense.
- marcosdumay 2y agoI always quit GHCi with Ctrl-D. I don't even know how else one is supposed to. Is there some setting that changes it?
- tomsmeding 2y agoAre you on Windows?
- chriswarbo 2y agoNo, this is in Emacs shell-mode on Linux (various distros over the years). Just tried a few other places: it works in qterminal, and also doesn't work in eshell. I've been writing Haskell for about 15 years, including my current job as a full-time Haskell developer, and I never realised GHCi supports Ctrl-D in some situations! Every other REPL I've used handles this fine, e.g. for quitting Python, Nix repl, SSH sessions, and even the shell itself. Weird.