diff options
author | Florrie <towerofnix@gmail.com> | 2019-01-25 09:10:14 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-01-25 09:10:14 -0400 |
commit | 6ca4f2e08d323b26940704eca89bdc71b4ed0160 (patch) | |
tree | bed14fba13e38f04659155d9eb1b17c0159188c1 | |
parent | 0c38fb468621b3860fc9c7deb12ae464c57996e8 (diff) |
Expose xterm alternate screen
-rw-r--r-- | util/ansi.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/util/ansi.js b/util/ansi.js index e7f7642..f30e6ff 100644 --- a/util/ansi.js +++ b/util/ansi.js @@ -123,6 +123,20 @@ const ansi = { return `${ESC}[6n` }, + enableAlternateScreen() { + // Enables alternate screen: + // "Xterm maintains two screen buffers. The normal screen buffer allows + // you to scroll back to view saved lines of output up to the maximum set + // by the saveLines resource. The alternate screen buffer is exactly as + // large as the display, contains no additional saved lines." + + return `${ESC}[?1049h` + }, + + disableAlternateScreen() { + return `${ESC}[?1049l` + }, + measureColumns(text) { // Returns the number of columns the given text takes. |