zx
zx copied to clipboard
repl hangs if command is waiting for input
Steps to Reproduce the Problem
zx --repl
await $`mv -i <file> <existing-file>`
Couldn't even find a way to abort (ctrl+c/d/z).
Specifications
- Version: Latest
- Platform: Mac
const { terminal } = require('terminal-kit')
/**
* run with kill (Ctrl + C)
*/
function rwk(...args) {
const p = $(...args)
const onKeyEvent = (key) => {
if (key === 'CTRL_C') {
p.kill()
}
}
terminal.addListener('key', onKeyEvent)
return p.finally(() => terminal.removeListener('key', onKeyEvent))
}
and then
await rwk`mv -i <file> <existing-file>`
you can interrupt the process with ctrl + c