File tree 2 files changed +21
-3
lines changed
src/Symfony/Component/Process
2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,13 @@ public function start($callback = null)
246
246
$ this ->status = self ::STATUS_STARTED ;
247
247
248
248
$ this ->processPipes ->unblock ();
249
+
250
+ if ($ this ->tty ) {
251
+ $ this ->status = self ::STATUS_TERMINATED ;
252
+
253
+ return ;
254
+ }
255
+
249
256
$ this ->processPipes ->write (false , $ this ->stdin );
250
257
$ this ->updateStatus (false );
251
258
$ this ->checkTimeout ();
@@ -740,7 +747,7 @@ public function setTty($tty)
740
747
}
741
748
742
749
/**
743
- * Checks if the TTY mode is enabled.
750
+ * Checks if the TTY mode is enabled.
744
751
*
745
752
* @return Boolean true if the TTY mode is enabled, false otherwise
746
753
*/
@@ -941,7 +948,7 @@ public function checkTimeout()
941
948
*/
942
949
private function getDescriptors ()
943
950
{
944
- $ this ->processPipes = new ProcessPipes ($ this ->useFileHandles );
951
+ $ this ->processPipes = new ProcessPipes ($ this ->useFileHandles , $ this -> tty );
945
952
$ descriptors = $ this ->processPipes ->getDescriptors ();
946
953
947
954
if (!$ this ->useFileHandles && $ this ->enhanceSigchildCompatibility && $ this ->isSigchildEnabled ()) {
Original file line number Diff line number Diff line change @@ -26,10 +26,13 @@ class ProcessPipes
26
26
private $ readBytes = array ();
27
27
/** @var Boolean */
28
28
private $ useFiles ;
29
+ /** @var Boolean */
30
+ private $ ttyMode ;
29
31
30
- public function __construct ($ useFiles = false )
32
+ public function __construct ($ useFiles, $ ttyMode )
31
33
{
32
34
$ this ->useFiles = (Boolean ) $ useFiles ;
35
+ $ this ->ttyMode = (Boolean ) $ ttyMode ;
33
36
34
37
// Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big.
35
38
// Workaround for this problem is to use temporary files instead of pipes on Windows platform.
@@ -108,6 +111,14 @@ public function getDescriptors()
108
111
);
109
112
}
110
113
114
+ if ($ this ->ttyMode ) {
115
+ return array (
116
+ array ('file ' , '/dev/tty ' , 'r ' ),
117
+ array ('file ' , '/dev/tty ' , 'w ' ),
118
+ array ('file ' , '/dev/tty ' , 'w ' ),
119
+ );
120
+ }
121
+
111
122
return array (
112
123
array ('pipe ' , 'r ' ), // stdin
113
124
array ('pipe ' , 'w ' ), // stdout
You can’t perform that action at this time.
0 commit comments