elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

Problem with ctrl+c on OS X (hardware fault) #121

Open evancz opened 8 years ago

evancz commented 8 years ago

In #99, @porglezomp reported that the REPL was acting weird on ctrl+c on an unspecified OS:

$ elm-repl
---- elm repl 0.16.0 -----------------------------------------------------------
 :help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> ^C
> elmtodo $ 
elm-repl: <stdin>: hGetChar: hardware fault (Input/output error)

@yurrriq did some testing and produced these tables (thank you!) running things on OS X 10.11.5:

Installation Method Result Extra Info
brew install elm πŸ‘Ž sh uninstall.sh first
Elm-Platform-0.17.1.pkg πŸ‘Ž brew unlink elm first
npm install -g elm πŸ‘Ž sh uninstall.sh first; node v6.2.2, npm 3.10.3
Build from source ❓ Don't have time right now

Trying to determine if it's my terminal or shell:

Terminal Shell Result
iTerm 2 (Build 3.0.3) fish πŸ‘Ž
bash πŸ‘Ž
Terminal Version 2.6.1 (361.1) fish πŸ‘Ž
bash πŸ‘Ž

Note: I am not able to reproduce any of this on my OS X 10.11.5 so I don't have any good leads. Could be something related to haskeline or something. No one has checked to see if they have any issues like this.

process-bot commented 8 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

porglezomp commented 8 years ago

I should note that I am no longer having the problem with Elm 0.17.0. I had been using Elm on another computer previously, and now, doing a fresh install with brew install elm (also on OS X 10.11.5) gives me an elm-repl that handles ^C correctly.

yurrriq commented 8 years ago

I doubt it, but maybe the fact that I have Caps Lock mapped to Left Control is a problem here. I've done it in the macOS System Preferences, not through a third party app.

evancz commented 8 years ago

@porglezomp, thanks for the update! @yurrriq, can you try disabling it to see if that resolves things?

yurrriq commented 8 years ago

@evancz: Did not fix. Side note: Made Emacs terrible for a minute there :wink:

michallepicki commented 7 years ago

I am using ubuntu 16.04 with xfce and I am affected by this bug using xfce4-terminal and elm-repl 0.17.1 in bash.

  1. Enter elm-repl
  2. Hit ctrl + c -> It seems that repl is closed (terminal prompt appears)
  3. Hit backspace twice (or do something else) -> An error appears: elm-repl: <stdin>: hGetChar: hardware fault (Input/output error).

I can see that repl runs in two system processes, /path/to/node/node /path/to/repl/elm-repl and other one (just elm-repl). After ctrl+c the node elm-repl one gets closed but the other one closes after the error.

redcpp commented 7 years ago

I am using Elementary OS (based on Ubuntu 16.04) and I am also affected by this bug using pantheon-terminal and elm-repl 0.18.0 in zsh with oh-my-zsh.

Installed elm-repl globally: $ npm install -g elm

  1. Enter elm-repl
  2. Hit ctrl + c -> It seems that repl is closed (terminal prompt appears)
  3. Wait around 3 seconds
  4. Hit Enter -> An error appears: elm-repl: : hGetChar: hardware fault (Input/output error).

Whenever I run elm-repl 6 similar processes are created via command: node /home/mancilla/.npm-global/bin/elm-repl And if I run any expression (e.g. > 1 * 8), processes with again many clones are created.

During the steps mentioned above there was a process with no clones with attached command: /home/mancilla/.npm-global/lib/node_modules/elm/Elm-Platform/0.18.0/.cabal-sandbox/elm-repl that after pressing ctrl + c is not closed. It closes after pressing Enter and the mentioned error (hardware fault) appears.

Seems like the pattern affects only to Linux platforms. Desktop, shell, terminal and distro (#120) are not a constant in every report of this bug.

arecvlohe commented 7 years ago

I am also experiencing the same issue using ctrl-c on my Mac OS X version 10.11.6, iTerm2 terminal with zsh.

When running the command elm repl two processes open, elm and elm-repl. When using ctr-c the elm processes dies but the elm-repl process remains running.

If I use the :exit or ctrl-\ command this issue does not occur.

harrysarson commented 6 years ago

I get this on Debian GNU/Linux buster/sid with the default terminal and elm v0.18.0