Releases: hymkor/csvi
v1.15.1
Changes in v1.15.1 in (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 in (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を削除。
v1.15.0
Changes in v1.15.0 in (English)
- Added key bindings
]and[to adjust the width of the current column (widen and narrow, respectively). - Added
-rvoption to prevent unnatural colors on terminals with a white background - At startup, the width of ambiguous-width Unicode characters was being measured, but on terminals that do not support the cursor position query sequence
ESC[6n, this could cause a hang followed by an error. To address this:-aw(treat ambiguous-width characters as 2 cells) and-an(treat ambiguous-width characters as 1 cell) options were added to skip the measurement and explicitly specify the character width.- If
ESC[6nis not supported, the program now continues without aborting.
- Suppress color output if the
NO_COLORenvironment variable is set (following https://no-color.org/ ) - Added support for FreeBSD/amd64
- Added API functions
(Config) EditFromStringSlice,uncsv.NewRowFromStringSliceand and(*_Application) MessageAndGetKey. - Split the
"csvi"package into subpackages such as"internal/ansi","internal/manualctl","legacy", and"candidate".
Changes in v1.15.0 in (Japanese)
- 現在カーソルがあるカラムの幅を広げるキー
]と、逆に狭める[を実装 - 白背景の端末でも色が不自然にならないよう、
-rvオプションを追加 - 起動時に曖昧幅の Unicode 文字の表示幅を計測していたが、カーソル位置を取得するシーケンス
ESC[6nをサポートしない端末では、入力待ちのままエラー終了してしまう問題があった。そのため:- 幅を明示的に指定して計測をスキップできる
-aw(曖昧幅を2セルとして扱う)および-an(曖昧幅を1セルとして扱う)オプションを追加した。 ESC[6nが無効な場合でもエラーとせず、編集を継続できるようにした。
- 幅を明示的に指定して計測をスキップできる
- 環境変数
NO_COLORが定義されている場合、カラー表示を抑制するようにした ( https://no-color.org/ に準拠 ) - FreeBSD/amd64 をサポート
- API関数:
(Config) EditFromStringSlice,uncsv.NewRowFromStringSlice,(*_Application) MessageAndGetKeyを追加 "csvi"パッケージを"internal/ansi","internal/manualctl","legacy","candidate"などのサブパッケージに分解した
v1.14.0
Changes in v0.13.1 and v0.14.0 (English)
- Added
L(Shift-L) command to reload the file using a specified encoding to correct detection errors- Encoding name completion is supported.
- UTF-16LE and UTF-16BE are not supported yet.
- Added search command (
*and#) to find the next occurrence of the current cell's content - Made it possible to build with Go 1.20.14 to support Windows 7, 8, and Server 2008 or later.
Changes in v0.13.1 and v0.14.0 (Japanese)
- エンコーディングの誤判定を修正するため、指定されたエンコーディングでファイルを再読み込みする
L(Shift-L) コマンドを追加- エンコーディング名の補完に対応
- UTF-16LE および UTF-16BE には未対応
- 現在カーソルがあるセルの内容で検索するコマンド
*,#を追加 - Windows 7,8,2008Server 環境での動作を可能にするため、Go 1.20.14 でビルドできるようにした
v1.13.0
Changes in v1.13.0 (English)
🚀 Experimental Release for macOS Users
This release includes a macOS build for the first time!
We don't have access to a macOS environment, so we can't test it ourselves.
If you're a macOS user and willing to help, please try it and report back through GitHub Issues or Discussions.
Thank you for your support!
Other changes
- Added
-titleoption to display a title row above the header row.
Please share your thoughts and feedback on this release in Discussion #5 .
Changes in v1.13.0 (Japanese)
🚀 実験的な macOS 版の公開
このリリースでは、初めて macOS 向けバイナリを含めています!
Go 製である本ツールは理論上 macOS でも動作可能ですが、作者自身は macOS を所持しておらず、動作確認ができていません。
そのため今回は、実験的なプレリリースという形で macOS 版を同梱し、動作確認へのご協力をお願いするものです。
✅ 動いた! ❌ ダメだった!
など、Issue ・Discussion などでフィードバックをもらえるととても助かります。
この macOS バイナリは、単に GOOS=darwin としてビルドしたもので、特別な対応は行っていません。今後の正式対応の参考にさせていただきます。
その他の変更
-titleオプションの追加により、ヘッダー行の上にタイトル行を表示できるようにした。
本リリースについてのご意見・フィードバックは #5 よりお願いいたします。
v1.12.0
- #4 Define the different width for cells. e.g.,
-w 14,0:10,1:20means: the first-column has 10 characters wide, the second 20, and other 14. (Thanks to @kevin-gwyrdh) - Fix: panic when 0 bytes files (
nulor/dev/null) were given
- #4 列ごとに違う幅を設定できるようにした。例:
-w 14,0:10,1:201列目は10桁,2列目は20桁,他は14桁とする (Thanks to @kevin-gwyrdh) - 0バイトのファイル(
nul,/dev/null)を与えるとクラッシュする不具合を修正
v1.11.1
Bug fix for the prediction implemented on v1.11.0
- Fix: the prediction did not start when the original value of the current cell was empty.
- Fix: the search target for the prediction shifted one column to the right when inserting a cell value with
a.
v1.11.0 で実装された予測機能の不具合修正
- 現行セルのオリジナルの値が空の時、予測表示が始まらない問題を修正
aでセル値を挿入する際、予測候補の検索先が一つ右の列にズレていた不具合を修正
v1.11.0
- While entering text in a cell, automatically display suggestions from cells in the same column that contain the current input. Press
→orCtrl-Fto accept.) go-readline-ny v1.5.0 - Support the hankaku-kana mode on the SKK input (
Ctrl-Qto enter the hankaku-kana mode from SKK kana mode) go-readline-skk v0.4.0
- セル編集中に、同じ列で現在入力中のテキストを含むセルのテキストを候補として自動的に表示し、
→もしくは Ctrl-F で採用できるようにしました go-readline-ny v1.5.0 - SKK入力で半角カナ入力をサポート(SKKのかな入力モードで
Ctrl-Qを押下する) go-readline-skk v0.4.0
v1.10.0
Changes from v1.9.1 to v1.10.0 (English)
New features
- Add new options:
-pProtect the header line (Config.ProtectHeaderfor package configuration ) - Do not create a row contains nothing but EOF.
- When
-fixcolis set, the new row whicho&Oinsert has all columns same as the row cursor exists
Fixed bugs
- When
-fixcolis specified- Fix:
oandO: inserted column was always the first one of the new line - Fix:
O: the line of cursor is incorrect before new cell text is input
- Fix:
- Fix timing to close the terminal input was incorrect
(The cause is unknown; however, the issue has not manifested)
Modifying package
- Added a mechanism for cell input validation
- User functions can be assigned to keys
- Make
uncsv.Cell.Original()that returns the original value before modified. csvi.Resulthas removed rows in a field.- Set 14 as the default of
csvi.Config.CellWidth - Implement
csvi.Config.Editas a function instead ofcsvi.Config.Mainas the entry function for external packages
v1.9.1 から v1.10.0 への変更点 (日本語)
新仕様
- 新オプション追加:
-pヘッダー行を保護 ( パッケージ用設定:Config.ProtectHeader) - EOF だけの行を作成しないようにした
-fixcol指定時、oやOで挿入される行は、カーソルのある行と同じ全列を持たせるようにした。
不具合修正
- カラム数固定(
-fixcol)の時oやOで入力されたテキストが記入される列がカーソルのあった列ではなく常に先頭列になっていた不具合を修正Oでテキストを入力する時の反転セルの行位置がずれている不具合を修正
- 端末入力(go-tty)のクローズタイミングがおかしかった点を修正
(なぜか問題として表面化していない)
パッケージ修正
- セルの入力チェックの仕組みを用意
- キーに関数を割り当てられるようにした
- 変更前のセル値を取得する
uncsv.Cell.Original()を用意した csvi.Resultに削除した行情報を保持させるようにした。csvi.Config.CellWidthのデフォルトを14桁とした- 外部へのエントリ関数として、
csvi.Config.Mainのかわりにcsvi.Config.Editを用意
v1.9.0
- Add the option
-fixcolthat disables keysi,a, andxnot to shift columns. - Move the main function to the sub-package
cmd/csvito be available as a package of Go - Add the option
-readonlythat forbide changing the value of cell. When enabled, "q" shutdowns csvi immediately
- 列をズレさせないよう、
i,a,xなどを無効にする オプション-fixcolを追加 - Goパッケージとして利用できるよう、main 関数を
cmd/mainへ移動 - セルの変更を禁止する
-readonlyオプションの追加。この時はqで確認プロンプトは出さない
v1.8.1
- Fix: crashed on starting
csviwith no arguments - Fix: a cell were not flipped when the cursor was in a cell with no text.
- Fix: the foreground color was not black, but gray.
- Change the case STDOUT or STDERR is used on no arguments to make the content of foo.txt becomes
foo\r\nwhen executingecho "foo" | csvi -auto "w|-|q|y" > foo.txt
- 引数なしで
csviを起動すると落ちる問題を修正 - テキストがないセルにカーソルがある時にセルが反転しない問題を修正
- カーソルの文字色が黒ではなく灰色になっていた不具合を修正
echo "foo" | csvi -auto "w|-|q|y" > foo.txtで foo.txt がfoo\r\nになるように、引数ゼロ時の標準出力と標準エラー出力の使い分けを変更した。
