!KVROvSYqmKzkzWMAyJ:matrix.org

Haskell RIO

3 Members
Discussion of the RIO library for Haskell1 Servers

Load older messages


SenderMessageTime
14 May 2018
@mgmeier:matrix.org@mgmeier:matrix.orgI see. The issue seems to imply that only Win 10 is affected?13:48:29
@snoyberg:matrix.orgMichael SnoymanThat might be the case, but I tested on Win 1013:48:51
@mgmeier:matrix.org@mgmeier:matrix.orgI'm using Win 7, so I'll give it a spin, see how the terminal output looks like13:49:28
@mgmeier:matrix.org@mgmeier:matrix.orgDisabling ANSI colors would be one way to go, the other utilizing the ANSI encoding resulting from ansi-terminal verbatim in the loggerFunc (we're talking about <10 literal values being defined locally, I'd say that's justifiable).13:51:39
@snoyberg:matrix.orgMichael SnoymanSGTM13:54:00
15 May 2018
@mgmeier:matrix.org@mgmeier:matrix.orgOk, my research shows that things aren't as straightforward as I assumed. Of course :)09:16:09
@mgmeier:matrix.org@mgmeier:matrix.orgRight now, RIO logger confirms for a handle only that it's connected to a terminal, assuming ANSI capabality.09:16:53
@mgmeier:matrix.org@mgmeier:matrix.orgOn Win, however, one should 1) unwrap the Win API HANDLE from GHC Handle, and check for ANSI capability.09:17:49
@mgmeier:matrix.org@mgmeier:matrix.orgThis succeds eg. for minTTY based solutions (like cygwin and git-bash), and ANSI emulation is enabled natively. On Win10 conhost terminals, it succeds, but ANSI emulation must first be enabled via some SetMode API call (this would account for seeing ANSI sequences in the console output). On older Win versions, capability check fails. cf. https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences09:21:13
@mgmeier:matrix.org@mgmeier:matrix.org what ansi-terminal does is perform all this, and fall back to mapping ANSI sequences to Win Conhost API calls, and return empty strings for all actual ANSI sequences. The detection code is here: https://github.com/feuerbach/ansi-terminal/blob/master/src/System/Console/ANSI/Windows/Detect.hs 09:23:25
@mgmeier:matrix.org@mgmeier:matrix.orgSo where does that leave us? Disabling ANSI based on os(windows) is not an option, since that negatively affects users of minTTY, where all is actually fine. Using ANSI sequences without performing a SetConsoleMode may result in garbage output.09:29:09
@mgmeier:matrix.org@mgmeier:matrix.org The emulation layer of ansi-terminal seems overkill to me; some simplified version of Detect.hs could be acceptable; there is however quite some system-level code involved (Win API calls, safely unwrapping a Handle, ...) 09:31:27
@mgmeier:matrix.org@mgmeier:matrix.orgWhat's your take on the issue?09:32:08
@snoyberg:matrix.orgMichael SnoymanDisabling completely based on os(windows) would be unfortunate, but not an automatic no IMO. Yes, it'll hurt minTTY users, but it may be a valid trade-off09:35:58
@snoyberg:matrix.orgMichael SnoymanThe emulation layer does seem like too much to me09:36:15
@snoyberg:matrix.orgMichael Snoyman Let me look at Detect.hs, that sounds about right 09:36:23
@mgmeier:matrix.org@mgmeier:matrix.orgI'm asking because RIO intends to be lightweight :) so if that means, no colors on windows whilst avoiding quite some extra code for a very special case.... that's a design decision IMO09:37:39
@snoyberg:matrix.orgMichael Snoyman Alright, so it seems like you'd be modifying logOptionsHandle to try using SetConsoleMode and, if it fails, just turn off color, right? 09:38:02
@snoyberg:matrix.orgMichael SnoymanYeah, I think you're advocating the right trade-off here09:38:14
@mgmeier:matrix.org@mgmeier:matrix.org
  1. yes and 2) 70% yes
09:38:46
@snoyberg:matrix.orgMichael Snoyman invited @appservice-irc:matrix.org@appservice-irc:matrix.org.12:20:23
@snoyberg:matrix.orgMichael Snoymanchanged room power levels.12:20:25
@appservice-irc:matrix.org@appservice-irc:matrix.org joined the room.12:20:26
@freenode_snoyberg2:matrix.org@freenode_snoyberg2:matrix.org joined the room.12:21:03
@appservice-irc:matrix.org@appservice-irc:matrix.orgchanged room power levels.12:21:03
@freenode_snoyberg2:matrix.org@freenode_snoyberg2:matrix.org left the room.12:29:05
@freenode_snoyberg2:matrix.org@freenode_snoyberg2:matrix.org joined the room.13:09:27
@freenode_snoyberg2:matrix.org@freenode_snoyberg2:matrix.org left the room.13:14:47
@freenode_bitemyapp:matrix.org@freenode_bitemyapp:matrix.org joined the room.14:17:36
@bitemyapp:matrix.org@bitemyapp:matrix.org joined the room.15:48:40

Show newer messages


Back to Room ListRoom Version: