How to enable inherit stdio? #426
Answered
by
antonmedv
PeterlitsZo
asked this question in
Help needed
-
I want to open a MySQL client. But its behavior is strange. Here is my zx script: await $`mysql -h localhost -P 3306 -u root -proot`; And here is my nodejs script, its behavior is normal: import { spawnSync } from 'node:child_process';
spawnSync("mysql", ['-h', 'localhost', '-P', '3306', '-u', 'root', '-proot'], { stdio: 'inherit' }); Strange behavior means it does not show the MySQL prefix if we want to enter a command. |
Beta Was this translation helpful? Give feedback.
Answered by
antonmedv
Jun 20, 2022
Replies: 1 comment 1 reply
-
Probably mysq looks for TTY on stdout, not stdin. By default zx uses await $`mysql ...`.stdio('inherit', 'inherit', 'inherit') |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
PeterlitsZo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably mysq looks for TTY on stdout, not stdin. By default zx uses
stdio: ['inherit', 'pipe', 'pipe']
.