Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl-C kills stack ghci when Docker is used #1163

Closed
nh2 opened this issue Oct 15, 2015 · 4 comments
Closed

Ctrl-C kills stack ghci when Docker is used #1163

nh2 opened this issue Oct 15, 2015 · 4 comments

Comments

@nh2
Copy link
Collaborator

nh2 commented Oct 15, 2015

On Linux, when I'm in stack ghci in stack's Docker environment, it doesn't clear the line or cancel the currently running function as expected, but instead shuts down the Docker container (thus killing the ghci session).

This gives tough times for doing e.g. web development in ghci (you can't cancel the server and quickly reload).

Most likely this is related to docker run signal propagation (we already had to deal with some of that fun in #547), and its -i (--interactive), -t (--tty), and --sig-proxy flags.

@nh2
Copy link
Collaborator Author

nh2 commented Oct 15, 2015

Some more investigation:

  • docker run -t -i stack-full ghci - Ctrl-C breaks ghci
  • docker run -t -i stack-full python - Ctrl-C breaks python
  • docker run -t -i stack-full bash - Ctrl-C does not break bash, it works as expected

It seems likely to me these interrupt problems are related to the entrypoint:

When I build a custom image based on Ubuntu that contains ghc (docker run ubuntu:14.04, apt-get install ghc inside there, docker commit ghc [thatcontainer]) and then docker run -t -i ghc ghci (or python) in there, I can Ctrl-C without problem, both ghci and python work as expected in there.

The entry point calls phusion/baseimage's my_init (as @borsboom mentions in #547 (comment)), which might be the reason why our entry point breaks ghci and python.

But I don't understand why it doesn't break bash!

@borsboom
Copy link
Contributor

Pretty sure this is issue is encompassed by #547, so closing. I'll add a note there to ensure this case is handled.

@nh2
Copy link
Collaborator Author

nh2 commented Oct 15, 2015

Workarond for now:

  • first run stack exec -- bash
  • then inside run stack ghci

and you can Ctrl-C safely.

@borsboom
Copy link
Contributor

FYI: this looks to be fixed in stack-0.1.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants