Skip to content

Commit 28d073e

Browse files
committed
fix: enable TTY support for npm watch process
1 parent bdb9c28 commit 28d073e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/Service/ThemeBuilder/TailwindCSS/Builder.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,20 @@ public function watch(
255255

256256
$process = new Process(['npm', 'run', 'watch'], $tailwindPath);
257257
$process->setTimeout(null);
258+
259+
if (Process::isTtySupported() && $output->isDecorated()) {
260+
try {
261+
$process->setTty(true);
262+
} catch (\RuntimeException $exception) {
263+
if ($isVerbose) {
264+
$io->warning(
265+
'TTY mode is not supported in this environment; ' .
266+
'running watch without TTY.'
267+
);
268+
}
269+
}
270+
}
271+
258272
$exitCode = $process->run(function ($type, $buffer) use ($output): void {
259273
$output->write($buffer);
260274
});

0 commit comments

Comments
 (0)