|
10 | 10 | use php\gui\layout\UXAnchorPane; |
11 | 11 | use php\gui\layout\UXHBox; |
12 | 12 | use php\gui\UXNode; |
13 | | -use php\intellij\pty\PtyProcess; |
| 13 | +use php\intellij\tty\PtyProcess; |
| 14 | +use php\intellij\tty\PtyProcessConnector; |
14 | 15 | use php\intellij\ui\JediTermWidget; |
| 16 | +use php\lib\str; |
15 | 17 |
|
16 | 18 | class TaskPanel { |
17 | 19 | /** |
@@ -63,8 +65,8 @@ public function setOnProcessExit(callable $callback) { |
63 | 65 | public function makeUI(): UXNode { |
64 | 66 | $this->process = PtyProcess::exec($this->processInfo->getProgram(), $this->processInfo->getEnvironment(), $this->processInfo->getDirectory()); |
65 | 67 |
|
66 | | - $this->terminal = new JediTermWidget($this->process, |
67 | | - ChangeThemeCommand::$instance->getCurrentTheme()->getTerminalTheme()->build()); |
| 68 | + $this->terminal = new JediTermWidget(ChangeThemeCommand::$instance->getCurrentTheme()->getTerminalTheme()->build()); |
| 69 | + $this->terminal->createTerminalSession(new PtyProcessConnector($this->process)); |
68 | 70 | $this->terminal->requestFocus(); |
69 | 71 | $this->terminal->start(); |
70 | 72 |
|
@@ -119,6 +121,10 @@ public function destroy() { |
119 | 121 |
|
120 | 122 | private function triggerDestroyEvent() { |
121 | 123 | uiLater(function () { |
| 124 | + $this->terminal->nextLine(); |
| 125 | + $this->terminal->nextLine(); |
| 126 | + $this->terminal->writeString( str::replace(((string)_("process.exit.message")), "%n", $this->process->getExitValue())); |
| 127 | + |
122 | 128 | call_user_func($this->onProcessExit, $this->process->getExitValue()); |
123 | 129 |
|
124 | 130 | if (!$this->configurationProcessExitTriggered) { |
|
0 commit comments