Skip to content

Instantly share code, notes, and snippets.

@jgillich
Created December 3, 2016 04:26
Show Gist options
  • Save jgillich/596a9254155b3036a85b3fc629220e9e to your computer and use it in GitHub Desktop.
Save jgillich/596a9254155b3036a85b3fc629220e9e to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<div id="terminal"
style="position:relative; width:100%; height:500px"></div>
</body>
<script src="hterm_all.js"></script>
<script>
hterm.defaultStorage = new lib.Storage.Local()
var t = new hterm.Terminal("foo")
t.onTerminalReady = function() {
var io = t.io.push();
io.onVTKeystroke = function(str) {
console.log(str)
};
io.sendString = function(str) {
console.log(str)
};
};
t.decorate(document.querySelector('#terminal'));
t.io.println('Print a string and add CRLF');
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment