Skip to content

Instantly share code, notes, and snippets.

@tokida
Created July 5, 2014 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tokida/997cf6b608d93ccbefef to your computer and use it in GitHub Desktop.
Save tokida/997cf6b608d93ccbefef to your computer and use it in GitHub Desktop.
*** 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
Copy link
Author

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