expose term instance to window for programatic use cases (#131)

* expose term to window for programatic use cases

* add a brief introduction about the exposed window.term variable
This commit is contained in:
Zhenhua Ben Cao
2018-10-08 03:55:36 -04:00
committed by Shuanglei Tao
parent 1f6a6c7b78
commit a428a7a430
3 changed files with 5 additions and 2 deletions

View File

@@ -247,7 +247,9 @@ var openWs = function() {
term.destroy();
}
term = new Terminal({
// expose term handle for some programatic cases
// which need to get the content of the terminal
term = window.term = new Terminal({
fontSize: 13,
fontFamily: '"Menlo for Powerline", Menlo, Consolas, "Liberation Mono", Courier, monospace',
theme: {