-
Notifications
You must be signed in to change notification settings - Fork 76
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
ANSI Color Support #63
Comments
While I like the idea of having colors in both the prompt as well as the printing functions, I don't quite understand why you propose to encode that information in the String instead of passing more structured data types to the relevant functions. Something along the lines of Disclaimer: I don't work on this library at all, just interested in better color support as well. |
I don't think that having escape sequences be part of the string are the only way to possibly do it, but it should be possible to set it up like that at some part of the data pipeline because that way the user can type in color format strings. Probably it could be more structured internally with a parsing function that accepts user input and turns it into the structured format. |
A point of detail: in respect of 'normal raw escape sequences', they did not work on legacy Windows but they do work on Windows 10. |
If the program enables them, yes. They are not on by default. |
I would like to mix haskeline with the ansi-terminal package to get cross platform colored text support that also has good command line support. However, it seems that the printer function that you obtain from
getExternalPrint
is actually only an action to queue text for later printing, so directly mixing it with thesetSGR
function from ansi-terminal doesn't work at all.Example:
Now I would ideally like to be able to encode the color changes into the String without using the normal raw escape sequences (which don't work on Windows anyway), ideally in a human-readable way so that users would be able to take advantage of this with their inputs. Then an escape sequence aware printing action can switch colors as it prints out the String. Here's an excerpt of the full example of what I mean.
This would probably necessitate that the printer that you get from
getExternalPrint
actually do the printing by blocking until the printing happens instead of just queuing it up for later. Or perhapsgetExternalPrint
can stay as it is (non-blocking) with updated docs, and then a new blocking printer function can be made available via a new InputT action.The text was updated successfully, but these errors were encountered: