Skip to content

Instantly share code, notes, and snippets.

@thatkookooguy
Last active January 28, 2016 08:12
Show Gist options
  • Save thatkookooguy/a08f447bf491e091e5e4 to your computer and use it in GitHub Desktop.
Save thatkookooguy/a08f447bf491e091e5e4 to your computer and use it in GitHub Desktop.
This will make tty.js open up a terminal in fullscreen after a user connects & change the background color to the default purple. This should be added to tty.js/static/
.terminal {
background-color: #300A24 !important;
}
if (window.tty) {
tty.on('open', function () {
window.tty.socket.on('connect', function() {
var w = new window.tty.Window();
// Race condition; do not like. Without this timeout, the
// terminal is rendered slightly too high and spills off
// the top edge of the canvas. C'est la vie en JavaScript.
setTimeout(function () {
w.maximize();
}, 100);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment