save cursor position before spawning process. fixes textareas.

This commit is contained in:
Christopher Jeffrey 2013-07-12 11:39:08 -05:00
parent dba2d39f80
commit 95c527ff73

View File

@ -887,6 +887,7 @@ Screen.prototype.spawn = function(file, args, options) {
options.stdio = 'inherit';
screen.program.saveCursor();
screen.program.normalBuffer();
screen.program.showCursor();
@ -916,6 +917,10 @@ Screen.prototype.spawn = function(file, args, options) {
process.stdout.write = write;
screen.program.alternateBuffer();
// Restoring the cursor, or resetting to program.x/y - either works.
// Technically, restoring cursor might be more foolproof.
// screen.program.cup(screen.program.y, screen.program.x);
screen.program.restoreCursor();
screen.program.hideCursor();
if (_listenedMouse) {
screen.program.enableMouse();