You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As noted in https://github.com/simonmichael/hledger/blob/master/hledger/Hledger/Cli/CliOptions.hs#L626, ifthe terminfo entry for $TERM can't be read, setupTermFromEnv throws an error. In particular, I'm encountering this when building hledger in a clean chroot that contains all its build dependencies, but doesn't contain the terminfo definitions for the terminal (kitty) I'm running the chrooted build in.
I'm a little loath to add kitty to the chroot unnecessarily, especially in view of the fact that hledger doesn't actually need an entire terminfo entry, just enough to tell the number of columns in the terminal. Given that the tests also pass with TERM=dumb, I'm guessing that its fallback settings are widely supported enough to work as an alternative.
Hence, I'd either recommend replacing the call to setupTermFromEnv with
Thanks for the report and suggestion. Is it something you could try to implement, @hseg ?
simonmichael
added
A-BUG
Something wrong, confusing or sub-standard in the software, docs, or user experience.
cli
Command line parsing, options, arguments and suchlike.
labels
Feb 25, 2025
(Note: Very niche reproducer)
As noted in https://github.com/simonmichael/hledger/blob/master/hledger/Hledger/Cli/CliOptions.hs#L626, ifthe
terminfo
entry for$TERM
can't be read,setupTermFromEnv
throws an error. In particular, I'm encountering this when buildinghledger
in a clean chroot that contains all its build dependencies, but doesn't contain the terminfo definitions for the terminal (kitty) I'm running the chrooted build in.I'm a little loath to add kitty to the chroot unnecessarily, especially in view of the fact that
hledger
doesn't actually need an entire terminfo entry, just enough to tell the number of columns in the terminal. Given that the tests also pass withTERM=dumb
, I'm guessing that its fallback settings are widely supported enough to work as an alternative.Hence, I'd either recommend replacing the call to
setupTermFromEnv
withor document this dependency on
TERM
being valid somewhere (perhaps this ticket suffices).For my part, I'm adding
TERM="dumb"
to my packaging script until this is fixed (much like I'd setLANG=C
to reset to a known-good situation).The text was updated successfully, but these errors were encountered: