concurrently handle input does not work as expected

521 views Asked by At

I am trying to combine two shell commands with concurrently lib and there should be option to forward user input into one of the child processes, see docs here, section --handle-input. But it somehow does not work in my case: npm script

    "test:unit": "concurrently --kill-others --handle-input --names test,build \"vitest --environment jsdom\" \"vite build --watch\"",

results in

[test]      Tests  1 failed | 12 passed (13)
[test]       Time  94ms
[test] 
[test] 
[test]  FAIL  Tests failed. Watching for file changes...
[test]        press u to update snapshot, press h to show help

I am pressing "u" as when I run it separately but nothing happen, even I tried to confirm by enter key.

So maybe I understand lib wrongly, or something. How can I pass my key strokes to child process "test"?

Thank you for any advise.

1

There are 1 answers

0
Luckylooke On

I get help in mentioned github issue. CREDIT to Mr. Pascal Jufer

Using --raw option did the thing!

So my final script is:

"test:unit": "concurrently --raw --kill-others --handle-input --names test,build \"vitest --environment jsdom\" \"vite build --watch\"",