#4332: regression: GHCi command output can no longer be redirected on a
by-command
basis
---------------------------------+------------------------------------------
Reporter: claus | Owner:
Type: bug | Status: new
Priority: normal | Component: GHCi
Version: 6.12.3 | Keywords:
Testcase: | Blockedby:
Os: Windows | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by claus):
[http://www.haskell.org/pipermail/glasgow-haskell-
users/2010-September/019231.html preliminary analysis]
In brief, the problematic commands use haskelline for output (why? isn't
haskelline just for logging and editing command *input* history?).
haskelline stores an output function which on Windows differs between
Console and non-Console output. GHCi only sets this output function once
per session, not once per command, so redirecting the output of a single
command from Console to a file causes `WriteConsole` to be called on a
non-Console, resulting in the `invalid handle` error.
Three possible fixes:
- don't use haskelline for output (unless there is a reason?)
- check the terminal status for haskelline output once per GHCi command
(since that status can change from command to command)
- expose a GHCi command to trigger haskellines terminal status check (this
would merely be a workaround)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4332#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs