Skip to content

v1.15.1

Choose a tag to compare

@hymkor hymkor released this 19 Oct 05:54
· 416 commits to master since this release

Changes in v1.15.1 (English)

Specification Changes

  • Removed runtime measurement for ambiguous-width Unicode characters
    Previously, csvi determined the display width of ambiguous-width characters (e.g., ) by printing them and reading the cursor position using ESC[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 variable RUNEWIDTH_EASTASIAN:

    • Double-width: set RUNEWIDTH_EASTASIAN=1
    • Single-width: set RUNEWIDTH_EASTASIAN=0 (any non-1 value with at least one character is also valid)

    The options -aw, -an, and -debug-bell have been removed accordingly.

  • Added automatic light-background detection
    When the environment variable COLORFGBG is defined as (FG);(BG) and the foreground value (FG) is smaller than (BG),
    csvi now 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/csvi to the subpackage startup.
  • 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=01 以外なら任意の1文字以上で可)

    これに伴い、オプション -aw, -an, -debug-bell を削除しました。

  • 白背景向け配色の自動判定を追加
    環境変数 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 を削除。