You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -191,7 +182,6 @@ public function startCommand(string $command): int|bool
191
182
$this->connection->sendExitStatus($this, $exitCode); // TODO: This should be in Channel, not Connection. Weird back and forth of responsibilities in Connection and Channel!
192
183
}
193
184
194
-
$this->process = null;
195
185
$this->childPid = null;
196
186
}
197
187
});
@@ -202,13 +192,9 @@ public function startCommand(string $command): int|bool
202
192
/**
203
193
* Write data from SSH client to the running command via PTY
204
194
*/
205
-
publicfunctionwriteToPty(string$data): int
195
+
publicfunctionwriteToCommand(string$data): int
206
196
{
207
-
if (! $this->pty) {
208
-
return0;
209
-
}
210
-
211
-
return$this->pty->write($data);
197
+
return$this->commandRunner->write($data);
212
198
}
213
199
214
200
/**
@@ -261,23 +247,15 @@ public function getPty(): ?Pty
261
247
*/
262
248
publicfunctionstopCommand(): void
263
249
{
264
-
if ($this->pty) {
265
-
$this->pty->stopCommand();
250
+
if (!is_null($this->commandRunner)) {
251
+
$this->commandRunner->stop();
266
252
}
267
253
268
254
if ($this->childPid) {
269
255
$this->debug('Stopping command with PID: '.$this->childPid);
270
256
posix_kill($this->childPid, SIGTERM);
271
257
$this->childPid = null;
272
258
}
273
-
274
-
if ($this->process && is_resource($this->process)) {
275
-
$this->debug('Stopping command with PID: '.$this->childPid);
276
-
proc_terminate($this->process, SIGTERM);
277
-
proc_close($this->process);
278
-
}
279
-
280
-
$this->process = null;
281
259
}
282
260
283
261
/**
@@ -310,12 +288,25 @@ public function setConnection(Connection $connection): void
0 commit comments