diff options
Diffstat (limited to 'src/terminal.c')
| -rw-r--r-- | src/terminal.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/terminal.c b/src/terminal.c index b1cb61fc0..e22f7bcf7 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -146,6 +146,8 @@ struct terminal_S { VTermPos tl_cursor_pos; int tl_cursor_visible; + + int tl_using_altscreen; }; #define TMODE_ONCE 1 /* CTRL-\ CTRL-N used */ @@ -1316,6 +1318,11 @@ handle_settermprop( out_flush(); break; + case VTERM_PROP_ALTSCREEN: + /* TODO: do anything else? */ + term->tl_using_altscreen = value->boolean; + break; + default: break; } @@ -1865,6 +1872,9 @@ create_vterm(term_T *term, int rows, int cols) /* Required to initialize most things. */ vterm_screen_reset(screen, 1 /* hard */); + + /* Allow using alternate screen. */ + vterm_screen_enable_altscreen(screen, 1); } /* @@ -1939,6 +1949,19 @@ term_get_buf(typval_T *argvars) } /* + * "term_getaltscreen(buf)" function + */ + void +f_term_getaltscreen(typval_T *argvars, typval_T *rettv) +{ + buf_T *buf = term_get_buf(argvars); + + if (buf == NULL) + return; + rettv->vval.v_number = buf->b_term->tl_using_altscreen; +} + +/* * "term_getattr(attr, name)" function */ void |
