question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stack run does not print text in terminal

See original GitHub issue

This isn’t completely related to intellij-haskell, but the run task is created from this plugin, so perhaps someone knows something about this.

I have a very simple test:

main = do
  putStrLn "Hello, what's your name?"
  name <- getLine
  putStrLn ("Hey " ++ name)

If I run it in my terminal or in the intellij terminal, using either stack run or stack build --exec ***.exe (what the plugin template uses), it works.

However, if I run the template, which launches the run tab, I don’t get the hello prompt until I type something and press enter. When I first tried this, I thought my project failed to build for many minutes.

Does anyone have any idea what’s going on here?

Using v1.0.0-beta40 on macOS

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
rikvdkleijcommented, Feb 3, 2019

Thanks for reporting!

I can reproduce this issue but I can not find the cause.

0reactions
rikvdkleijcommented, Sep 5, 2019

No problem 😄

I do not know how to enable it by default because it’s in the Haskell code. Also do not see a Stack option for this.

Alternative: In the Run/Debug configuration window, display a warning that it may be necessary to add this for basic IO, like

Yes, that is the most simple alternative solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Won't print anything on terminal - Stack Overflow
Printf when I run the command to execute, appear very quickly the response but is deleted on terminal. package main import "fmt" func...
Read more >
How can I stop myself from printing my terminal - Ask Different
So I frequently hit cmd+p , type some text, and then hit enter. I'm worried I'll accidentally do this in terminal (which would...
Read more >
How to print text in the terminal as if it's being typed?
This does not work with Wayland; if you're using Ubuntu 17.10 and didn't change to using Xorg at login, this solution isn't for...
Read more >
zsh script not printing output of "jobs" command? - Super User
No experience with zsh, but on a general level: Have you verified that $(jobs) actually generates output?
Read more >
traceback — Print or retrieve a stack traceback — Python 3.11 ...
Each string ends in a newline; the strings may contain internal newlines as well, for those items whose source text line is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found