Skip to content

Instantly share code, notes, and snippets.

@io4
Created February 28, 2017 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save io4/f751c2a5df2083c7824c2ab5fed09646 to your computer and use it in GitHub Desktop.
Save io4/f751c2a5df2083c7824c2ab5fed09646 to your computer and use it in GitHub Desktop.
[ROOT] Make node.js takeover a tty. Do Ctrl-Alt-F3
const fs = require("fs");
const child_process = require("child_process");
var stdio = [
fs.openSync("/dev/tty3","w+"),
fs.openSync("/dev/tty3","r+"),
fs.openSync("/dev/tty3","r+")
];
child_process.spawn("/bin/bash", [], {stdio});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment