Created
August 8, 2018 14:49
-
-
Save yuu/fcd8b0969b61e4e5f4b4ef6d55c9eae0 to your computer and use it in GitHub Desktop.
tmux v2.7 wide char patch from https://gist.github.com/waltarix/1399751
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/options-table.c b/options-table.c | |
index f611ba0..be2e92b 100644 | |
--- a/options-table.c | |
+++ b/options-table.c | |
@@ -321,6 +321,12 @@ const struct options_table_entry options_table[] = { | |
.default_num = 0 | |
}, | |
+ { .name = "pane-border-ascii", | |
+ .type = OPTIONS_TABLE_FLAG, | |
+ .scope = OPTIONS_TABLE_SESSION, | |
+ .default_num = 0 | |
+ }, | |
+ | |
{ .name = "prefix", | |
.type = OPTIONS_TABLE_KEY, | |
.scope = OPTIONS_TABLE_SESSION, | |
diff --git a/tty-acs.c b/tty-acs.c | |
index 1f7a2b1..0a7a251 100644 | |
--- a/tty-acs.c | |
+++ b/tty-acs.c | |
@@ -64,6 +64,41 @@ static const struct tty_acs_entry tty_acs_table[] = { | |
{ '~', "\302\267" } /* bullet */ | |
}; | |
+static const struct tty_acs_entry tty_acs_table_putty[] = { | |
+ { '+', "\342\206\222" }, /* arrow pointing right */ | |
+ { ',', "\342\206\220" }, /* arrow pointing left */ | |
+ { '-', "\342\206\221" }, /* arrow pointing up */ | |
+ { '.', "\342\206\223" }, /* arrow pointing down */ | |
+ { '0', "\342\226\256" }, /* solid square block */ | |
+ { '`', "\342\227\206" }, /* diamond */ | |
+ { 'a', "\342\226\222" }, /* checker board (stipple) */ | |
+ { 'f', "\302\260" }, /* degree symbol */ | |
+ { 'g', "\302\261" }, /* plus/minus */ | |
+ { 'h', "\342\226\222" }, /* board of squares */ | |
+ { 'i', "\342\230\203" }, /* lantern symbol */ | |
+ { 'j', "+" }, /* lower right corner */ | |
+ { 'k', "+" }, /* upper right corner */ | |
+ { 'l', "+" }, /* upper left corner */ | |
+ { 'm', "+" }, /* lower left corner */ | |
+ { 'n', "+" }, /* large plus or crossover */ | |
+ { 'o', "\342\216\272" }, /* scan line 1 */ | |
+ { 'p', "\342\216\273" }, /* scan line 3 */ | |
+ { 'q', "-" }, /* horizontal line */ | |
+ { 'r', "\342\216\274" }, /* scan line 7 */ | |
+ { 's', "\342\216\275" }, /* scan line 9 */ | |
+ { 't', "+" }, /* tee pointing right */ | |
+ { 'u', "+" }, /* tee pointing left */ | |
+ { 'v', "+" }, /* tee pointing up */ | |
+ { 'w', "+" }, /* tee pointing down */ | |
+ { 'x', "|" }, /* vertical line */ | |
+ { 'y', "\342\211\244" }, /* less-than-or-equal-to */ | |
+ { 'z', "\342\211\245" }, /* greater-than-or-equal-to */ | |
+ { '{', "\317\200" }, /* greek pi */ | |
+ { '|', "\342\211\240" }, /* not-equal */ | |
+ { '}', "\302\243" }, /* UK pound sign */ | |
+ { '~', "*" } /* bullet */ | |
+}; | |
+ | |
static int | |
tty_acs_cmp(const void *key, const void *value) | |
{ | |
@@ -114,7 +149,9 @@ tty_acs_get(struct tty *tty, u_char ch) | |
} | |
/* Otherwise look up the UTF-8 translation. */ | |
- entry = bsearch(&ch, tty_acs_table, nitems(tty_acs_table), | |
+ entry = bsearch(&ch, | |
+ options_get_number(global_s_options, "pane-border-ascii") ? tty_acs_table_putty : tty_acs_table, | |
+ nitems(tty_acs_table), | |
sizeof tty_acs_table[0], tty_acs_cmp); | |
if (entry == NULL) | |
return (NULL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment