headless-terminal
Advanced tools
Comparing version
@@ -58,2 +58,16 @@ | ||
this.termWriter.write(whatever) | ||
this._check() | ||
} | ||
// ### resize(cols, rows) | ||
// | ||
// Resizes the size of the terminal. | ||
// After that, a change event will be emitted. | ||
// | ||
HeadlessTerminal.prototype.resize = function(cols, rows) { | ||
this.termBuffer.resize(cols, rows) | ||
this._check() | ||
} | ||
HeadlessTerminal.prototype._check = function() { | ||
var screen = this.displayBuffer | ||
@@ -60,0 +74,0 @@ , buffer = this.termBuffer |
{ | ||
"name": "headless-terminal", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Headless xterm emulator using vt (terminal.js).", | ||
@@ -5,0 +5,0 @@ "main": "headless-terminal.js", |
@@ -35,2 +35,7 @@ # new HeadlessTerminal(cols, rows) | ||
### resize(cols, rows) | ||
Resizes the size of the terminal. | ||
After that, a change event will be emitted. | ||
## Events | ||
@@ -37,0 +42,0 @@ |
@@ -46,3 +46,11 @@ | ||
}) | ||
it('should allow resizing', function() { | ||
var terminal = new HeadlessTerminal(4, 3) | ||
terminal.open() | ||
terminal.write('a\r\n\x1b[38;5;22ma\x1b[48;5;1mbn\x1b[mc\r\nd') | ||
terminal.resize(4, 2) | ||
assertBuffer(terminal.displayBuffer, ['abnc','d'], [[enc(null, 22), enc(1, 22), enc(1, 22), enc()], [enc()]]) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7207
11.01%166
12.93%57
9.62%0
-100%