icyphox / fab

:star2: print fabulously in your terminal
MIT License
49 stars 6 forks source link

Use terminal.styledEcho? #1

Closed kaushalmodi closed 6 years ago

kaushalmodi commented 6 years ago

Hello,

I see that you are using the ANSI escape codes at low level.

Have you looked at terminal.styledEcho? May be having your procs wrappers around styledEcho adds Windows compatibility?

On UNIX, the implementation simply uses ANSI escape sequences and does not depend on any other module, on Windows it uses the Windows API.

icyphox commented 6 years ago

Hey, I'm aware of terminal.styledEcho, but I couldn't seem to echo multiple colors in a single line.
Perhaps submit a PR if you can get it to work?

kaushalmodi commented 6 years ago

See https://github.com/kaushalmodi/fab/blob/use-styled-echo/README.md.

kaushalmodi commented 6 years ago

I agree that the procs don't get composable as in your approach, but it's still possible, and IMO the code is more readable.

In summary, you don't have to merge this. But this was a fun exercise :)

icyphox commented 6 years ago

I saw your repo, and hey, it looks good to me. Feel free to submit a PR :')

I'm going to reopen this, if someone has a better approach.