google/goexpect

Is there a way to do sendcontrol?

andy8leung opened this issue · 4 comments

In Pexpect, you can issue a ctrl-c command like expect.sendcontrol('c'). Is there a way to do this with goexpect?

Ctrl-c Should just be as simple as sending the number 3 , not the asciicharacter 3 mind you ..

e.Send("\003")

https://www.asciitable.com/
http://jkorpela.fi/chars/c0.html

Hey al31n , did sending CtrlC work for you?

Hi Skalle, sorry for the late response. Yes sending Ctrl C works. Thanks!

Hi @al31n
Did e.Send("\003") worked for you .
I was trying to do something similar where i need to send CTRL-K and the ASCII for it is \013.
But no luck.