Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
*** tmux-1.9a.orig/utf8.c 2014-02-23 05:48:37.000000000 +0900
--- tmux-1.9a/utf8.c 2014-07-06 00:43:50.000000000 +0900
***************
*** 22,27 ****
--- 22,32 ----
#include "tmux.h"
+
+ #define _XOPEN_SOURCE
+ #include <locale.h>
+ #include <wchar.h>
+
struct utf8_width_entry {
u_int first;
u_int last;
***************
*** 339,345 ****
struct utf8_width_entry *item;
u_int value;
! value = utf8_combine(utf8data);
item = utf8_width_root;
while (item != NULL) {
--- 344,360 ----
struct utf8_width_entry *item;
u_int value;
! static int inited = 0;
!
! value = utf8_combine(utf8data);
! /*
! if (!inited) {
! setlocale(LC_CTYPE, "");
! inited = 1;
! }
! return wcwidth(value);
! */
! return (value <= 0x7f) ? 1 : 2;
item = utf8_width_root;
while (item != NULL) {
@tokida

This comment has been minimized.

Show comment
Hide comment
@tokida

tokida Jul 5, 2014

iTerm2を用いていて「Treat ambiguous-width characters as double width」をONにしているとtmuxがズレていく問題の修正。
参考:http://ta.ps.st/d/1350718711.html

Owner

tokida commented Jul 5, 2014

iTerm2を用いていて「Treat ambiguous-width characters as double width」をONにしているとtmuxがズレていく問題の修正。
参考:http://ta.ps.st/d/1350718711.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment