Skip to content

Instantly share code, notes, and snippets.

@utahta
Last active May 17, 2017 06:06
Show Gist options
  • Save utahta/6f14dc33ec0700f3f2f224e0ce84c772 to your computer and use it in GitHub Desktop.
Save utahta/6f14dc33ec0700f3f2f224e0ce84c772 to your computer and use it in GitHub Desktop.
patches for tmux 2.4

tmux-2.4 で日本語の様子がおかしい問題の対策 for mac

tmux/tmux#873   https://github.com/tmux/tmux/commit/55cd4c7bc756509f241788f7f73676676ef538f6

Apply patch

$ brew edit tmux

and add below

def patches
  [
    "https://gist.githubusercontent.com/utahta/6f14dc33ec0700f3f2f224e0ce84c772/raw/fd87552e02f75013d65783493247315ca1754e8e/tmux-2.4-input.patch",
    "https://gist.githubusercontent.com/utahta/6f14dc33ec0700f3f2f224e0ce84c772/raw/fd87552e02f75013d65783493247315ca1754e8e/tmux-2.4-screen-write.patch",
  ]
end

Reinstall tmux

$ tmux kill-server
$ brew uninstall tmux
$ brew install tmux -s
diff --git a/input.c b/input.c
index 0b667390..a33d0747 100644
--- a/input.c
+++ b/input.c
@@ -2011,7 +2011,7 @@ input_utf8_close(struct input_ctx *ictx)
(int)ud->size, ud->data, ud->width);
utf8_copy(&ictx->cell.cell.data, ud);
- screen_write_cell(&ictx->ctx, &ictx->cell.cell);
+ screen_write_collect_add(&ictx->ctx, &ictx->cell.cell);
return (0);
}
diff --git a/screen-write.c b/screen-write.c
index 1af3b32f..41f1c23c 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1113,7 +1113,7 @@ screen_write_collect_add(struct screen_write_ctx *ctx,
*/
collect = 1;
- if (gc->data.width != 1)
+ if (gc->data.width != 1 || gc->data.size != 1)
collect = 0;
else if (gc->attr & GRID_ATTR_CHARSET)
collect = 0;
@bigwheel
Copy link

同じ現象でここ数週間悩んでいました。非常に助かります!

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