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

Set TTY depending on execution context for all processes #332

Merged
merged 3 commits into from
Aug 16, 2021

Conversation

roborourke
Copy link
Contributor

Makes sure that output is properly formatted.

Makes sure that output is properly formatted.
@roborourke roborourke requested a review from tfrommen August 16, 2021 13:52
@roborourke
Copy link
Contributor Author

Here's the follow on @tfrommen!

@roborourke roborourke requested a review from shadyvb August 16, 2021 13:53
@rmccue
Copy link
Member

rmccue commented Aug 16, 2021

These should be set based on whether the current process is a TTY, no?

@roborourke
Copy link
Contributor Author

The start command has had this for ages so we're bringing them in line with that #328

We only use tty detection for the exec command right now.

@rmccue
Copy link
Member

rmccue commented Aug 16, 2021

Seems like they should consistently do so though; otherwise, something like composer server logs php | tee some.log | tail -f will likely break.

@roborourke
Copy link
Contributor Author

Using $process->setPty( true ) (pseudo terminal) works, Symfony figures out whether the output is being piped to something else or not.

Copy link
Contributor

@tfrommen tfrommen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colors! 😍

@rmccue
Copy link
Member

rmccue commented Aug 16, 2021

I am thinking more like $process->setTty( posix_isatty( STDOUT ) ); passing the code through. Setting pty won't pass through interactive prompts if those would have occurred (iirc)

@roborourke roborourke changed the title Set TTY true for all processes Set TTY depending on execution context for all processes Aug 16, 2021
@roborourke roborourke merged commit 3b34155 into master Aug 16, 2021
@roborourke roborourke deleted the tty-all-the-things branch August 16, 2021 17:43
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

Successfully merging this pull request may close these issues.

3 participants