Programatically run commands into terminal
hallahan opened this issue · comments
Nick Hallahan commented
I'm trying to figure out how to programatically run commands into the terminal.
This get's a string into the terminal, but \n
or \r
doesn't execute the command.
tty.terms["/dev/ttys001"].write('ls');
How do I programatically ENTER
?
Nick Hallahan commented
Figured it out!
tty.socket.emit('data', '/dev/ttys001', '\r')
If I directly submit \r
via the web socket connection, I can get ENTER to the terminal server.