diff options
author | nicm <nicm> | 2020-05-16 16:44:54 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-05-16 16:44:54 +0000 |
commit | 0ab82d95314e7a26a48452c77ad710f3aff97dd7 (patch) | |
tree | 8a7439d2a3007bb7de92f6c8c801bb5303754fae /input.c | |
parent | 292b335ca5b594729cf9ff79f0f4273c725537a4 (diff) | |
download | rtmux-0ab82d95314e7a26a48452c77ad710f3aff97dd7.tar.gz rtmux-0ab82d95314e7a26a48452c77ad710f3aff97dd7.tar.bz2 rtmux-0ab82d95314e7a26a48452c77ad710f3aff97dd7.zip |
Add a terminal feature for enable/disable extended keys (supported by
xterm and mintty) and add an option to make tmux send it. Only forward
extended keys if the application has requested them, even though we use
the CSI u sequence and xterm uses CSI 27 ~ - this is what mintty does as
well.
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -241,6 +241,8 @@ enum input_csi_type { INPUT_CSI_HPA, INPUT_CSI_ICH, INPUT_CSI_IL, + INPUT_CSI_MODOFF, + INPUT_CSI_MODSET, INPUT_CSI_RCP, INPUT_CSI_REP, INPUT_CSI_RM, @@ -289,7 +291,9 @@ static const struct input_table_entry input_csi_table[] = { { 'l', "", INPUT_CSI_RM }, { 'l', "?", INPUT_CSI_RM_PRIVATE }, { 'm', "", INPUT_CSI_SGR }, + { 'm', ">", INPUT_CSI_MODSET }, { 'n', "", INPUT_CSI_DSR }, + { 'n', ">", INPUT_CSI_MODOFF }, { 'q', " ", INPUT_CSI_DECSCUSR }, { 'q', ">", INPUT_CSI_XDA }, { 'r', "", INPUT_CSI_DECSTBM }, @@ -1380,6 +1384,19 @@ input_csi_dispatch(struct input_ctx *ictx) if (n != -1 && m != -1) screen_write_cursormove(sctx, m - 1, n - 1, 1); break; + case INPUT_CSI_MODSET: + n = input_get(ictx, 0, 0, 0); + m = input_get(ictx, 1, 0, 0); + if (n == 0 || (n == 4 && m == 0)) + screen_write_mode_clear(sctx, MODE_KEXTENDED); + else if (n == 4 && (m == 1 || m == 2)) + screen_write_mode_set(sctx, MODE_KEXTENDED); + break; + case INPUT_CSI_MODOFF: + n = input_get(ictx, 0, 0, 0); + if (n == 4) + screen_write_mode_clear(sctx, MODE_KEXTENDED); + break; case INPUT_CSI_WINOPS: input_csi_dispatch_winops(ictx); break; @@ -1593,7 +1610,7 @@ input_csi_dispatch(struct input_ctx *ictx) break; case INPUT_CSI_XDA: n = input_get(ictx, 0, 0, 0); - if (n != 0) + if (n == 0) input_reply(ictx, "\033P>|tmux %s\033\\", getversion()); break; |