We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some terminal programs (like file watchers) just run indefinitely until you do ctrl+c to send a SIGINT to exit the program.
ctrl+c
How would I do this from nexpect? Is there a control character I could send through .sendline() to get the same effect as ctrl+c?
.sendline()
The text was updated successfully, but these errors were encountered:
nexpect returns the spawned child process, I can't recall exactly from which method, but look at https://github.com/nodejitsu/nexpect/blob/master/lib/nexpect.js#L298. That process supports a .kill() method.
Sorry, something went wrong.
The following works for me:
const {pid} = spawn('cat') // This won’t end by itself. .expect(/* … */) ; process.kill(pid); // So let’s kill it!
Is there a control character I could send through .sendline() to get the same effect as ctrl+c?
I don’t think it’s possible – Ctrl + C sends the SIGINT signal and not a control character. I’ve just learned that on Stack Exchange.
Ctrl + C
But you can achieve the same as Ctrl + D (end of file/input) with nexpect’s .sendEof().
Ctrl + D
.sendEof()
No branches or pull requests
Some terminal programs (like file watchers) just run indefinitely until you do
ctrl+c
to send a SIGINT to exit the program.How would I do this from nexpect? Is there a control character I could send through
.sendline()
to get the same effect asctrl+c
?The text was updated successfully, but these errors were encountered: