From 9aad945f7e58112c3f8819f658e379d672842d73 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 21 Dec 2021 14:57:28 +0000 Subject: Support underscore style with capture-pane -e, GitHub issue 2928. --- tty-features.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tty-features.c') diff --git a/tty-features.c b/tty-features.c index 48ac51be..3aca2520 100644 --- a/tty-features.c +++ b/tty-features.c @@ -363,7 +363,7 @@ tty_default_features(int *feat, const char *name, u_int version) }, { .name = "iTerm2", .features = TTY_FEATURES_BASE_MODERN_XTERM - ",cstyle,extkeys,margins,sync" + ",cstyle,extkeys,margins,usstyle,sync" }, { .name = "XTerm", /* -- cgit From 792d13af49f2550a9a8d11b0099528628957a1a0 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 24 Mar 2022 09:05:57 +0000 Subject: Add a capability for OSC 7 and use it similarly to how the title is set (and controlled by the same set-titles option). GitHub issue 3127. --- tty-features.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tty-features.c') diff --git a/tty-features.c b/tty-features.c index 3aca2520..4d83a465 100644 --- a/tty-features.c +++ b/tty-features.c @@ -53,6 +53,18 @@ static const struct tty_feature tty_feature_title = { 0 }; +/* Terminal has OSC 7 working directory. */ +static const char *tty_feature_osc7_capabilities[] = { + "Swd=\\E]7;", + "fsl=\\a", + NULL +}; +static const struct tty_feature tty_feature_osc7 = { + "osc7", + tty_feature_osc7_capabilities, + 0 +}; + /* Terminal has mouse support. */ static const char *tty_feature_mouse_capabilities[] = { "kmous=\\E[M", @@ -249,6 +261,7 @@ static const struct tty_feature *tty_features[] = { &tty_feature_focus, &tty_feature_margins, &tty_feature_mouse, + &tty_feature_osc7, &tty_feature_overline, &tty_feature_rectfill, &tty_feature_rgb, -- cgit From 20b0b38cf47112c0219b5bd041d61c5a28fae0fd Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 30 May 2022 12:57:31 +0000 Subject: iTerm2 has OSC 7, from Gregory Anders. --- tty-features.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tty-features.c') diff --git a/tty-features.c b/tty-features.c index 4d83a465..2848b4d6 100644 --- a/tty-features.c +++ b/tty-features.c @@ -376,7 +376,7 @@ tty_default_features(int *feat, const char *name, u_int version) }, { .name = "iTerm2", .features = TTY_FEATURES_BASE_MODERN_XTERM - ",cstyle,extkeys,margins,usstyle,sync" + ",cstyle,extkeys,margins,usstyle,sync,osc7" }, { .name = "XTerm", /* -- cgit From 616bde08ac74d4be0ae06087aa3103df54833f86 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 14 Jun 2022 07:29:00 +0000 Subject: kf* terminfo capabilities are poorly defined and rxvt uses them in a different way from xterm, so add a feature flag for rxvt to make tmux ignore the capabilities and instead rely on its builtin definitions. --- tty-features.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) (limited to 'tty-features.c') diff --git a/tty-features.c b/tty-features.c index 2848b4d6..477925e3 100644 --- a/tty-features.c +++ b/tty-features.c @@ -250,6 +250,80 @@ static const struct tty_feature tty_feature_rectfill = { TERM_DECFRA }; +/* Use builtin function keys only. */ +static const char *tty_feature_ignorefkeys_capabilities[] = { + "kf0@", + "kf1@", + "kf2@", + "kf3@", + "kf4@", + "kf5@", + "kf6@", + "kf7@", + "kf8@", + "kf9@", + "kf10@", + "kf11@", + "kf12@", + "kf13@", + "kf14@", + "kf15@", + "kf16@", + "kf17@", + "kf18@", + "kf19@", + "kf20@", + "kf21@", + "kf22@", + "kf23@", + "kf24@", + "kf25@", + "kf26@", + "kf27@", + "kf28@", + "kf29@", + "kf30@", + "kf31@", + "kf32@", + "kf33@", + "kf34@", + "kf35@", + "kf36@", + "kf37@", + "kf38@", + "kf39@", + "kf40@", + "kf41@", + "kf42@", + "kf43@", + "kf44@", + "kf45@", + "kf46@", + "kf47@", + "kf48@", + "kf49@", + "kf50@", + "kf51@", + "kf52@", + "kf53@", + "kf54@", + "kf55@", + "kf56@", + "kf57@", + "kf58@", + "kf59@", + "kf60@", + "kf61@", + "kf62@", + "kf63@", + NULL +}; +static const struct tty_feature tty_feature_ignorefkeys = { + "ignorefkeys", + tty_feature_ignorefkeys_capabilities, + 0 +}; + /* Available terminal features. */ static const struct tty_feature *tty_features[] = { &tty_feature_256, @@ -259,6 +333,7 @@ static const struct tty_feature *tty_features[] = { &tty_feature_cstyle, &tty_feature_extkeys, &tty_feature_focus, + &tty_feature_ignorefkeys, &tty_feature_margins, &tty_feature_mouse, &tty_feature_osc7, @@ -372,7 +447,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,mouse,title" + .features = "256,bpaste,ccolour,cstyle,mouse,title,ignorefkeys" }, { .name = "iTerm2", .features = TTY_FEATURES_BASE_MODERN_XTERM -- cgit From cdacc12ce305ad2f3e65e2a01328a988e3200b51 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 30 Jun 2022 09:55:53 +0000 Subject: Add support for OSC 8 hyperlinks (a VTE extension now supported by other terminals such as iTerm2). Originally written by me then extended and completed by first Will Noble and later Jeff Chiang. GitHub issues 911, 2621, 2890, 3240. --- tty-features.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tty-features.c') diff --git a/tty-features.c b/tty-features.c index 477925e3..396a351e 100644 --- a/tty-features.c +++ b/tty-features.c @@ -87,6 +87,17 @@ static const struct tty_feature tty_feature_clipboard = { 0 }; +/* Terminal supports OSC 8 hyperlinks. */ +static const char *tty_feature_hyperlinks_capabilities[] = { + "*:Hls=\\E]8;%?%p1%l%tid=%p1%s%;;%p2%s\\E\\\\", + NULL +}; +static const struct tty_feature tty_feature_hyperlinks = { + "hyperlinks", + tty_feature_hyperlinks_capabilities, + 0 +}; + /* * Terminal supports RGB colour. This replaces setab and setaf also since * terminals with RGB have versions that do not allow setting colours from the @@ -330,6 +341,7 @@ static const struct tty_feature *tty_features[] = { &tty_feature_bpaste, &tty_feature_ccolour, &tty_feature_clipboard, + &tty_feature_hyperlinks, &tty_feature_cstyle, &tty_feature_extkeys, &tty_feature_focus, @@ -444,14 +456,14 @@ tty_default_features(int *feat, const char *name, u_int version) }, { .name = "tmux", .features = TTY_FEATURES_BASE_MODERN_XTERM - ",ccolour,cstyle,focus,overline,usstyle" + ",ccolour,cstyle,focus,overline,usstyle,hyperlinks" }, { .name = "rxvt-unicode", .features = "256,bpaste,ccolour,cstyle,mouse,title,ignorefkeys" }, { .name = "iTerm2", .features = TTY_FEATURES_BASE_MODERN_XTERM - ",cstyle,extkeys,margins,usstyle,sync,osc7" + ",cstyle,extkeys,margins,usstyle,sync,osc7,hyperlinks" }, { .name = "XTerm", /* -- cgit From f08c019d419d7deefce2e8ab699aad404895355a Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 30 Jun 2022 16:46:26 +0100 Subject: Do not set Hls for hyperlinks on ncurses older than 5.9 (for example macOS). --- tty-features.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tty-features.c') diff --git a/tty-features.c b/tty-features.c index 396a351e..e387f823 100644 --- a/tty-features.c +++ b/tty-features.c @@ -89,7 +89,11 @@ static const struct tty_feature tty_feature_clipboard = { /* Terminal supports OSC 8 hyperlinks. */ static const char *tty_feature_hyperlinks_capabilities[] = { +#if defined (__OpenBSD__) || (defined(NCURSES_VERSION_MAJOR) && \ + (NCURSES_VERSION_MAJOR > 5 || \ + (NCURSES_VERSION_MAJOR == 5 && NCURSES_VERSION_MINOR > 8))) "*:Hls=\\E]8;%?%p1%l%tid=%p1%s%;;%p2%s\\E\\\\", +#endif NULL }; static const struct tty_feature tty_feature_hyperlinks = { -- cgit From 697cebb4c1a28e0dc5b76037cb912eb1ace700b3 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 19 Jul 2022 07:48:48 +0100 Subject: Include curses properly for hyperlinks ifdef, from chrysn at fsfe dot org. --- tty-features.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tty-features.c') diff --git a/tty-features.c b/tty-features.c index e387f823..64f0039a 100644 --- a/tty-features.c +++ b/tty-features.c @@ -21,6 +21,12 @@ #include #include +#if defined(HAVE_CURSES_H) +#include +#elif defined(HAVE_NCURSES_H) +#include +#endif + #include "tmux.h" /* -- cgit