summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/input.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-02-08 00:14:39 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-02-08 00:14:39 +0000
commit357a13dd0465acb9e070b0363cdf8ae561ee396f (patch)
treea2aa68ff7d8ba67dfc17cd11dbf17dedc46fd828 /usr.bin/tmux/input.c
parentbebc96f43bcc836956b2128e9e27c8665dc594ca (diff)
Add an option to disable the smcup/rmcup alternate screen behaviour inside
tmux. From clemens fischer.
Diffstat (limited to 'usr.bin/tmux/input.c')
-rw-r--r--usr.bin/tmux/input.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c
index 53b0c567705..70080438b58 100644
--- a/usr.bin/tmux/input.c
+++ b/usr.bin/tmux/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.26 2010/01/06 23:13:52 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.27 2010/02/08 00:14:38 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1148,6 +1148,7 @@ void
input_handle_sequence_sm(struct input_ctx *ictx)
{
struct window_pane *wp = ictx->wp;
+ struct options *oo = &wp->window->options;
struct screen *s = &wp->base;
u_int sx, sy;
uint16_t n;
@@ -1178,6 +1179,8 @@ input_handle_sequence_sm(struct input_ctx *ictx)
case 1049:
if (wp->saved_grid != NULL)
break;
+ if (!options_get_number(oo, "alternate-screen"))
+ break;
sx = screen_size_x(s);
sy = screen_size_y(s);
@@ -1224,6 +1227,7 @@ void
input_handle_sequence_rm(struct input_ctx *ictx)
{
struct window_pane *wp = ictx->wp;
+ struct options *oo = &wp->window->options;
struct screen *s = &wp->base;
u_int sx, sy;
uint16_t n;
@@ -1254,6 +1258,8 @@ input_handle_sequence_rm(struct input_ctx *ictx)
case 1049:
if (wp->saved_grid == NULL)
break;
+ if (!options_get_number(oo, "alternate-screen"))
+ break;
sx = screen_size_x(s);
sy = screen_size_y(s);