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

Pretty console output doesn't restore terminal cursor (Lighthouse #3) #46

Open
fatuhoku opened this issue Mar 28, 2013 · 3 comments
Open

Comments

@fatuhoku
Copy link

Originally reported by Edward Z. Yang | August 26th, 2010 @ 06:31 PM

Run a test-framework driver.

Expected: When it's done, my terminal cursor is restored
Actual: Terminal cursor not restored.

This might be ansi-terminal/ansi-wl-pprint's fault, or we might not be calling the correct reset frob.

@fatuhoku
Copy link
Author

Edward Z. Yang replies on August 26th, 2010 @ 10:34 PM

Extra information: this only seems to occur when using runghc, not when running a compiled binary.

@fatuhoku
Copy link
Author

Edward Z. Yang replies on August 26th, 2010 @ 10:45 PM

Fix is to explicitly flush after you restore the cursor:

hideCursorDuring :: IO a -> IO a
hideCursorDuring action = bracket hideCursor (const (showCursor >> hFlush stdout)) (const action)

@fatuhoku
Copy link
Author

Edward Z. Yang replies on August 26th, 2010 @ 10:48 PM

See also here; it looks like this got fixed in GHC 6.12.3.

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

1 participant