Skip to content

Instantly share code, notes, and snippets.

@jerch
Created August 10, 2021 21:10
Show Gist options
  • Save jerch/29f5039a46cd9efd6a123aedb312ce0f to your computer and use it in GitHub Desktop.
Save jerch/29f5039a46cd9efd6a123aedb312ce0f to your computer and use it in GitHub Desktop.
const pty = require('./lib/index');
var ptyProcess = pty.spawn('bash', [], {
name: 'xterm-color',
cols: 80,
rows: 30,
cwd: '/',
env: process.env
});
ptyProcess.on('data', function(data) {
process.stdout.write(data);
});
setTimeout(() => {
ptyProcess.write('pwd\r');
ptyProcess.write('tty\r');
}, 300);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment