diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-07-21 21:10:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-07-21 21:10:01 +0200 |
commit | e906ae85b291ccc7da842b7ac609c697bb582e1f (patch) | |
tree | 383f6908167bc82b82379b82b58a7058431d047e /src/libvterm | |
parent | 58556cd0e592cba75bf60310d822a20e41f6b02e (diff) | |
download | vim-git-e906ae85b291ccc7da842b7ac609c697bb582e1f.tar.gz |
patch 8.0.0740: cannot resize a terminal window by the commandv8.0.0740
Problem: Cannot resize a terminal window by the command running in it.
Solution: Add support for the window size escape sequence. Make BS work.
Diffstat (limited to 'src/libvterm')
-rw-r--r-- | src/libvterm/src/state.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libvterm/src/state.c b/src/libvterm/src/state.c index 5b777c909..1b7e89d31 100644 --- a/src/libvterm/src/state.c +++ b/src/libvterm/src/state.c @@ -9,6 +9,8 @@ # define DEBUG_GLYPH_COMBINE #endif +static int on_resize(int rows, int cols, void *user); + /* Some convenient wrappers to make callback functions easier */ static void putglyph(VTermState *state, const uint32_t chars[], int width, VTermPos pos) @@ -1396,6 +1398,14 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha break; + case 0x74: + switch(CSI_ARG(args[0])) { + case 8: /* CSI 8 ; rows ; cols t set size */ + if (argcount == 3) + on_resize(CSI_ARG(args[1]), CSI_ARG(args[2]), state); + } + break; + case INTERMED('\'', 0x7D): /* DECIC */ count = CSI_ARG_COUNT(args[0]); @@ -1534,7 +1544,7 @@ static void request_status_string(VTermState *state, const char *command, size_t switch(state->mode.cursor_shape) { case VTERM_PROP_CURSORSHAPE_BLOCK: reply = 2; break; case VTERM_PROP_CURSORSHAPE_UNDERLINE: reply = 4; break; - case VTERM_PROP_CURSORSHAPE_BAR_LEFT: reply = 6; break; + default: /* VTERM_PROP_CURSORSHAPE_BAR_LEFT */ reply = 6; break; } if(state->mode.cursor_blink) reply--; |