akinomyoga / ble.sh

Bash Line Editor―a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc. for Bash interactive sessions.
BSD 3-Clause "New" or "Revised" License
2.72k stars 86 forks source link

fzf-menu integration crashes with util-linux 2.37.2 #530

Open christianknauer opened 1 day ago

christianknauer commented 1 day ago

ble version: 0.4.0-devel4+31f264ad Bash version: 5.1.16(1)-release (x86_64-pc-linux-gnu)

The column tool from util-linux 2.37.2 (on Ubuntu 22.04.1) does not recognize the placeholder "unlimited" for the -c (--output-width) option. fzf-menu.bash (in contrib/integration) uses this placeholder (l. 45) and causes a "crash". Changing "unlimited" to "0" fixes the problem.

The column tool from util-linux 2.39.3 (on Ubuntu 24.04.1 LTS) does recognize the placeholder (so no crash there).

akinomyoga commented 22 hours ago

Thanks for the report. I haven't cared so much about the compatibility in contrib as contrib is originally meant to provide example settings, but I probably need to care about it as we started to document them in detail, and more users start to use them.

The option -c unlimited seems to have been introduced in https://github.com/util-linux/util-linux/commit/35d5d655c5bc58c52ae6d440eea69b39f1cfb4fc for util-linux v2.39. As far as I see the change and the associated discussion https://github.com/util-linux/util-linux/issues/1618, there hadn't been the same feature before v2.39. Specifying -c 0 doesn't produce the error, but it is interpreted differently before v2.39. Rewriting unlimited to 0 would cause other issues in the versions where unlimited is unsupported.