Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

concurrently handle input does not work as expected

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.

like image 817
Luckylooke Avatar asked Oct 29 '25 21:10

Luckylooke


1 Answers

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\"",
like image 102
Luckylooke Avatar answered Nov 02 '25 23:11

Luckylooke