lua: add pane:is_alt_screen_active()

This commit is contained in:
Funami580 authored and Wez Furlong committed 2022-07-12 17:06:16 -07:00
1 parent d4d33369f2
commit cfa95db0cc
2 files changed
+10

No files matched your search

@@ -0,0 +1,7 @@
# `pane:is_alt_screen_active()`
*Since: nightly builds only*
Returns whether the alternate screen is active for the pane.
The alternate screen is a secondary screen that is activated by certain escape codes. The alternate screen has no scrollback, which makes it ideal for a "full-screen" terminal program like `vim` or `less` to do whatever they want on the screen without fear of destroying the user's scrollback. Those programs emit escape codes to return to the normal screen when they exit.
+3
View File
@@ -63,6 +63,9 @@ impl UserData for PaneObject {
methods.add_method("has_unseen_output", |_, this, _: ()| {
Ok(this.pane()?.has_unseen_output())
});
methods.add_method("is_alt_screen_active", |_, this, _: ()| {
Ok(this.pane()?.is_alt_screen_active())
});
// When called with no arguments, returns the lines from the
// viewport as plain text (no escape sequences).