diff --git a/lib/widget.js b/lib/widget.js index 9845e8b..c61d3eb 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -2017,9 +2017,9 @@ Screen.prototype._cursorAttr = function(cursor, dattr) { Screen.prototype.screenshot = function(xi, xl, yi, yl, term) { if (xi == null) xi = 0; - if (xl == null) xl = this.lpos.xl; + if (xl == null) xl = this.cols; if (yi == null) yi = 0; - if (yl == null) yl = this.lpos.yl; + if (yl == null) yl = this.rows; var x , y diff --git a/test/widget.js b/test/widget.js index 4b029b0..5e42dde 100644 --- a/test/widget.js +++ b/test/widget.js @@ -252,6 +252,12 @@ button.on('press', function() { screen.append(button); +screen.key('S-s', function() { + stext.wrap = false; + stext.setContent(screen.screenshot()); + screen.render(); +}); + screen.on('keypress', function(ch, key) { if (key.name === 'tab') { return key.shift