summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tty.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/tty.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/tty.c')
-rw-r--r--usr.bin/tmux/tty.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 1ce4b8fb8e8..6ba77cc7a19 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.114 2012/02/15 17:25:02 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.115 2012/03/03 09:43:23 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -480,6 +480,12 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s)
else
tty_putcode(tty, TTYC_RMKX);
}
+ if (changed & MODE_BRACKETPASTE) {
+ if (mode & MODE_BRACKETPASTE)
+ tty_puts(tty, "\033[?2004h");
+ else
+ tty_puts(tty, "\033[?2004l");
+ }
tty->mode = mode;
}