aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2012-03-07 13:36:19 +0000
committerTiago Cunha <tcunha@gmx.com>2012-03-07 13:36:19 +0000
commit3275e9bd5b4f9d8aa3961d3468fcd6765191fcc3 (patch)
treed4250d114482e2b2101db7428b742702d9a4a48d /tty.c
parent9d79a56402850ac35c57e35fe39990d84e1fd5fa (diff)
downloadrtmux-3275e9bd5b4f9d8aa3961d3468fcd6765191fcc3.tar.gz
rtmux-3275e9bd5b4f9d8aa3961d3468fcd6765191fcc3.tar.bz2
rtmux-3275e9bd5b4f9d8aa3961d3468fcd6765191fcc3.zip
Sync OpenBSD patchset 1037:
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 'tty.c')
-rw-r--r--tty.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tty.c b/tty.c
index dca95cc9..b1034304 100644
--- a/tty.c
+++ b/tty.c
@@ -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;
}