v1.15.1
Changes in v1.15.1 (English)
Specification Changes
-
Removed runtime measurement for ambiguous-width Unicode characters
Previously,csvidetermined the display width of ambiguous-width characters (e.g.,∇) by printing them and reading the cursor position usingESC[6n].
This caused issues on some older terminals and added unnecessary complexity, so the feature has been removed.
The program now relies solely on mattn/go-runewidth for width determination.
In most cases it works correctly, but if the width is misdetected, you can control it with the environment variableRUNEWIDTH_EASTASIAN:- Double-width:
set RUNEWIDTH_EASTASIAN=1 - Single-width:
set RUNEWIDTH_EASTASIAN=0(any non-1value with at least one character is also valid)
The options
-aw,-an, and-debug-bellhave been removed accordingly. - Double-width:
-
Added automatic light-background detection
When the environment variableCOLORFGBGis defined as(FG);(BG)and the foreground value(FG)is smaller than(BG),
csvinow automatically uses color settings for light backgrounds (equivalent to-rv).
Bug Fixes
- Fixed an issue where executing
echo "ihihi" | csvi -auto "w|-|q|y" > file, resulted in unwanted text
\r Calibrating terminal... (press any key to skip)\r
appearing at the beginning of the output file.
This was caused by fallback handling in the old width-measurement logic, which has now been removed, so the problem no longer occurs.
Internal Changes
- Moved command-line option parsing from the main package
cmd/csvito the subpackagestartup. - Removed the deprecated function
(Config) Main.
Changes in v1.15.1 (Japanese)
仕様変更
-
曖昧幅の Unicode 文字の実測による幅判定を廃止
曖昧幅(Ambiguous Width)文字(例:∇)の表示幅をESC[6nにより実測して自動判定していましたが、古い端末で動作しないなどの問題があったため、この方式を廃止しました。
今後は mattn/go-runewidth による自動判断だけを使用します。ほとんどの環境では正しく動作しますが、まれに誤判定する場合は環境変数RUNEWIDTH_EASTASIANで指定してください。- 2桁幅にする場合:
set RUNEWIDTH_EASTASIAN=1 - 1桁幅にする場合:
set RUNEWIDTH_EASTASIAN=0(1以外なら任意の1文字以上で可)
これに伴い、オプション
-aw,-an,-debug-bellを削除しました。 - 2桁幅にする場合:
-
白背景向け配色の自動判定を追加
環境変数COLORFGBGが(FG);(BG)形式で定義されており、前景色が背景色より小さい数値の場合、白背景を想定した配色(-rv相当)を自動適用するようにしました。
不具合修正
echo "ihihi" | csvi -auto "w|-|q|y" > file実行時に、出力の先頭へ\r Calibrating terminal... (press any key to skip)\rが混入する問題を修正しました。原因は、曖昧幅実測が失敗した際のフォロー処理によるもので、この機構の廃止により再発しません。
内部的変更
- コマンドラインオプション解析処理を
"cmd/csvi"から"startup"パッケージへ移動。 - 非推奨の関数
(Config) Mainを削除。