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

Coloring difference between nox and overmind #1

Open
jwoertink opened this issue Dec 29, 2021 · 4 comments
Open

Coloring difference between nox and overmind #1

jwoertink opened this issue Dec 29, 2021 · 4 comments

Comments

@jwoertink
Copy link

Here's what Nox looks like when I boot my app
Screen Shot 2021-12-29 at 8 44 01 AM

Here's what Overmind looks like
Screen Shot 2021-12-29 at 8 46 18 AM

There's a few differences here:

  • Nox shows the yarn run v1.22.17 line under "web" as where Overmind just has it on its own line. I'm not sure which is better...
  • Same goes for the actual browser-sync command.
  • The [Browsersync] in "web" on Nox isn't colorized, but in Overmind it is. Notice in the assets it is though
  • Same goes for some links
@matthewmcgarvey
Copy link
Collaborator

I think it might be connected to the fact that Overmind uses PTY (pseudo-terminals) which causes the command to think it's outputting to the terminal, while Nox does not so the command thinks it's outputting to a file. I would like for it to look no different than Overmind's output, but Crystal doesn't have a library that implements PTY right now.

https://evilmartians.com/chronicles/introducing-overmind-and-hivemind

You could verify this by running it with foreman since it doesn't use PTY either and compare the output.

There might be some stuff that isn't attributed to this, though. Like the yarn run ... thing. I'll try to look into it.

@jwoertink
Copy link
Author

Ah cool. Yup. Tried with foreman, and it looks the same. I'm cool with how it looks, I just wanted to make sure we weren't losing out on something. I did try doing some puts "***".colorize.yellow and it came out fine, so we're at least catching that.

@matthewmcgarvey
Copy link
Collaborator

Yep, pretty sure it only affects utilities that have different output styling based on what it's outputting to. The article's example is Sidekiq. The article also mentions that there could be lag with a lot of output, but I'm sure it will be fine 😟

@matthewmcgarvey
Copy link
Collaborator

It's weird coming back to this issue, checking to see if there are any PTY shards out there yet, finding one and thinking "ahh, but it's kinda old" and then realizing that it's newer than this conversation we had almost 3 years ago.

Anyways: https://github.com/crystal-posix/pty.cr might be helpful

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

2 participants