summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-06-10 07:59:09 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-06-10 07:59:09 +0000
commit517beee0a1d3f453f20d462479fad8c981587133 (patch)
tree0bedc11c06264f03316abd9ee1e4a071d2966f42 /usr.bin
parentdd056fad59c9e41dbc10488754a5f764412f782a (diff)
Feature for the mouse since FreeBSD termcap does not have kmous.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/tmux.16
-rw-r--r--usr.bin/tmux/tty-features.c19
2 files changed, 20 insertions, 5 deletions
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 2d55b9f61ea..8273596854f 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.841 2021/06/10 07:56:47 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.842 2021/06/10 07:59:08 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -3540,6 +3540,10 @@ Supports extended keys.
Supports focus reporting.
.It margins
Supports DECSLRM margins.
+.It mouse
+Supports
+.Xr xterm 1
+mouse sequences.
.It overline
Supports the overline SGR attribute.
.It rectfill
diff --git a/usr.bin/tmux/tty-features.c b/usr.bin/tmux/tty-features.c
index 3a055702b3d..537920347ba 100644
--- a/usr.bin/tmux/tty-features.c
+++ b/usr.bin/tmux/tty-features.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-features.c,v 1.19 2021/06/10 07:28:45 nicm Exp $ */
+/* $OpenBSD: tty-features.c,v 1.20 2021/06/10 07:59:08 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -25,7 +25,6 @@
/*
* Still hardcoded:
- * - mouse (under kmous capability);
* - default colours (under AX or op capabilities);
* - AIX colours (under colors >= 16);
* - alternate escape (if terminal is VT100-like).
@@ -54,6 +53,17 @@ static const struct tty_feature tty_feature_title = {
0
};
+/* Terminal has mouse support. */
+static const char *tty_feature_mouse_capabilities[] = {
+ "kmous=\\E[M",
+ NULL
+};
+static const struct tty_feature tty_feature_mouse = {
+ "mouse",
+ tty_feature_mouse_capabilities,
+ 0
+};
+
/* Terminal can set the clipboard with OSC 52. */
static const char *tty_feature_clipboard_capabilities[] = {
"Ms=\\E]52;%p1%s;%p2%s\\a",
@@ -238,6 +248,7 @@ static const struct tty_feature *tty_features[] = {
&tty_feature_extkeys,
&tty_feature_focus,
&tty_feature_margins,
+ &tty_feature_mouse,
&tty_feature_overline,
&tty_feature_rectfill,
&tty_feature_rgb,
@@ -338,7 +349,7 @@ tty_default_features(int *feat, const char *name, u_int version)
const char *features;
} table[] = {
#define TTY_FEATURES_BASE_MODERN_XTERM \
- "256,RGB,bpaste,clipboard,strikethrough,title"
+ "256,RGB,bpaste,clipboard,mouse,strikethrough,title"
{ .name = "mintty",
.features = TTY_FEATURES_BASE_MODERN_XTERM
",ccolour,cstyle,extkeys,margins,overline,usstyle"
@@ -348,7 +359,7 @@ tty_default_features(int *feat, const char *name, u_int version)
",ccolour,cstyle,focus,overline,usstyle"
},
{ .name = "rxvt-unicode",
- .features = "256,bpaste,ccolour,cstyle,title"
+ .features = "256,bpaste,ccolour,cstyle,mouse,title"
},
{ .name = "iTerm2",
.features = TTY_FEATURES_BASE_MODERN_XTERM