summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-03-03 09:43:22 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-03-03 09:43:22 +0000
commitf4fdddc9306886e3ab5257f40003f6db83ac926b (patch)
tree0c2408c8a736a203ecbe35ff8a7f737adceab4e3 /screen-write.c
parent4b8bb7770fc06ae61942372ff7edc38b64efb58d (diff)
Support "bracketed paste" mode. This adds a -p flag to paste-buffer - if
this is used and the application has requested bracketed pastes, then tmux surrounds the pasted text by \033[200~ and \033[201~. Applications like vim can (apparently) use this to avoid, for example, indenting the text. From Ailin Nemui.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/screen-write.c b/screen-write.c
index 784f02e2..d8659593 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -878,6 +878,18 @@ screen_write_mousemode_on(struct screen_write_ctx *ctx, int mode)
s->mode |= mode;
}
+/* Set bracketed paste mode. */
+void
+screen_write_bracketpaste(struct screen_write_ctx *ctx, int state)
+{
+ struct screen *s = ctx->s;
+
+ if (state)
+ s->mode |= MODE_BRACKETPASTE;
+ else
+ s->mode &= ~MODE_BRACKETPASTE;
+}
+
/* Line feed. */
void
screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped)