]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Add lineFeed event
authort-amqi <umberos@gmail.com>
Mon, 24 Jul 2017 18:43:03 +0000 (11:43 -0700)
committert-amqi <umberos@gmail.com>
Mon, 24 Jul 2017 18:43:03 +0000 (11:43 -0700)
- this is useful for checking when a cmd is entered or when a cmd finishes
- also handy to have for accessibility for output

src/InputHandler.ts

index 15d10c57f754d99cfb159c5266e95e017c2c695f..7cad6f09fc332c65b4e8427b97078381d542ac69 100644 (file)
@@ -132,6 +132,12 @@ export class InputHandler implements IInputHandler {
     if (this._terminal.buffer.x >= this._terminal.cols) {
       this._terminal.buffer.x--;
     }
+  /**
+   * This event is emitted whenever the terminal outputs a LF or NL.
+   *
+   * @event lineFeed
+   */
+    this._terminal.emit('lineFeed');
   }
 
   /**
@@ -281,7 +287,7 @@ export class InputHandler implements IInputHandler {
       this._terminal.buffer.y = this._terminal.rows - 1;
     }
     this._terminal.buffer.x = 0;
-  };
+  }
 
 
   /**
@@ -299,7 +305,7 @@ export class InputHandler implements IInputHandler {
       this._terminal.buffer.y = 0;
     }
     this._terminal.buffer.x = 0;
-  };
+  }
 
 
   /**
@@ -1107,7 +1113,7 @@ export class InputHandler implements IInputHandler {
           this._terminal.cursorHidden = true;
           break;
         case 1049: // alt screen buffer cursor
-          ; // FALL-THROUGH
+           // FALL-THROUGH
         case 47: // normal screen buffer
         case 1047: // normal screen buffer - clearing it first
           // Ensure the selection manager has the correct buffer