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
{{ message }}
Repository navigation
Terminal width lookup fails unnecessarily if terminfo unpopulated #2332
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
Activity
simonmichael commentedon Feb 25, 2025
Thanks for the report and suggestion. Is it something you could try to implement, @hseg ?
fix: Use POSIX API to compute tty width (hledgerorg#2332)
fix: Use POSIX API to compute tty width (#2332)
fix: Use POSIX API to compute tty width (#2332)
simonmichael commentedon Feb 28, 2025
Now fixed thanks to #2340 I believe ?
hseg commentedon Feb 28, 2025
simonmichael commentedon Feb 28, 2025
I merged it in a funny way (which is not my preference, but sometimes I don't know how to avoid it).