summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-03-03 09:43:24 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-03-03 09:43:24 +0000
commit4290d0074c3a62f29fee68911f28828f92246a23 (patch)
tree6278f75d11c4c3a2867ff5dd179528cd8ec7b669 /usr.bin/tmux/screen-write.c
parent10be96f2d3f09efc66492720718c3dedc5ed5657 (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 'usr.bin/tmux/screen-write.c')
-rw-r--r--usr.bin/tmux/screen-write.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index d6de7dce1e0..208ebff8e41 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.52 2012/01/21 08:10:21 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.53 2012/03/03 09:43:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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)