Bug 234822 - [PATCH] sysutils/tmux: Add utf8proc option to Makefile
Summary: [PATCH] sysutils/tmux: Add utf8proc option to Makefile
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Mathieu Arnold
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-10 14:30 UTC by David O'Rourke
Modified: 2019-01-10 14:30 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (mat)


Attachments
sysutils/tmux: Add utf8proc option to Makefile (767 bytes, patch)
2019-01-10 14:30 UTC, David O'Rourke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David O'Rourke 2019-01-10 14:30:54 UTC
Created attachment 200987 [details]
sysutils/tmux: Add utf8proc option to Makefile

This patch adds an option to compile tmux with utf8proc support, and defaults it to on.

This patch comes after I spent a while tracking down why I was having issues with various characters in the terminal and reading through https://github.com/tmux/tmux/issues/1057. Within that issue, there is a newtest.txt file which I was using to test tmux in a reliable way.

The characters within the file are a "hugging face" and a "glowing star". They are definitely printable characters. They're listed at emojipedia as:
  - https://emojipedia.org/glowing-star/
  - https://emojipedia.org/hugging-face/

Tmux compiled without utf8proc will show the following when displaying the above file:
Unicode 1f917, wcwidth() -1
input_top_bit_set 4 '\360\237\244\227' (width 1)
Unicode 1f31f, wcwidth() -1
input_top_bit_set 4 '\360\237\214\237' (width 1)

The wcwidth() lines are showing that wcwidth(3) failed to properly detect the character width, which leads to display issues later on.

Once compiled against utf8proc, the above becomes:
input_top_bit_set 4 '\360\237\244\227' (width 2)
input_top_bit_set 4 '\360\237\214\237' (width 2)

The character width is correctly detected and display issues no longer happen.

I made this an option instead of just enabling it in the CONFIGURE_ARGS since maybe someone, somewhere depends on the odd wcwidth() behaviour.

-David