-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Process] Disable TTY mode on Windows platform #10763
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
Conversation
romainneutron
commented
Apr 22, 2014
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
License | MIT |
doesn't this require a testsuite change ? |
Updated, added a test on Windows platform |
*/ | ||
public function setTty($tty) | ||
{ | ||
if (defined('PHP_WINDOWS_VERSION_BUILD')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should throw the exception only when trying to set it to true, not when setting it to false.
@stof I've addressed your comment |
👍 |
*/ | ||
public function setTty($tty) | ||
{ | ||
if (defined('PHP_WINDOWS_VERSION_BUILD') && $tty) { | ||
throw new RuntimeException('TTY mode is not supported on Windows platform.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a LogicException rather than a RuntimeException IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been hesitating but I chose RuntimeException
because we're already using this one in case Process::signal
is called whereas the PHP has been compiled with --enable-sigchild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is an error of logic in this case, it's just the platform does not support it
Thank you @romainneutron. |
…ron) This PR was merged into the 2.3 branch. Discussion ---------- [Process] Disable TTY mode on Windows platform | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Commits ------- 7942c2a [Process] Disable TTY mode on Windows platform