Bug 234822 - [PATCH] sysutils/tmux: Add utf8proc option to Makefile
Summary: [PATCH] sysutils/tmux: Add utf8proc option to Makefile
Status: Closed FIXED
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
Depends on:
Reported: 2019-01-10 14:30 UTC by David O'Rourke
Modified: 2019-04-10 16:01 UTC (History)
0 users

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

sysutils/tmux: Add utf8proc option to Makefile (767 bytes, patch)
2019-01-10 14:30 UTC, David O'Rourke
no flags Details | Diff
newtest.txt (62 bytes, text/plain)
2019-04-03 20:51 UTC, David O'Rourke
no flags Details

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.

Comment 1 David O'Rourke 2019-04-03 20:51:29 UTC
Created attachment 203355 [details]

This is the test file from GitHub to avoid having to go hunting for it. I should have included this in the beginning.
Comment 2 commit-hook freebsd_committer 2019-04-10 16:01:54 UTC
A commit references this bug:

Author: mat
Date: Wed Apr 10 16:01:38 UTC 2019
New revision: 498577
URL: https://svnweb.freebsd.org/changeset/ports/498577

  Add a default option to use utf8proc for Unicode normalization,
  case-folding, and other operations.

  It is substantially better and more up-to-date than the libc functions
  providing the same features.

  PR:		234822
  Submitted by:	David O'Rourke