hledger/hledger-lib/Hledger/Utils
gesh a24c39f13f fix: Use POSIX API to compute tty width (#2332)
On some systems, TERM is set to a value that doesn't have a valid
terminfo entry. Rather than hackily fall back on a value for TERM that
appears to work in most contexts (TERM=dumb) but which isn't guaranteed
anywhere to be valid, use proper POSIX ioctls to get the tty width.

This has the added bonus of also working on Windows.

In fact, we already settled on computing the terminal size in this way
in hledger-lib, so this commit centralizes the choice of the logic
there.

Also added a note for alternative methods and their tradeoffs, in case
this turns out to be fragile on some systems.
2025-02-27 13:41:48 -10:00
..
Debug.hs dev: split debug/ghcdebug flags, comment out the latter for now 2024-10-24 10:44:28 -10:00
IO.hs fix: Use POSIX API to compute tty width (#2332) 2025-02-27 13:41:48 -10:00
Parse.hs dev: refactor: merge Text.Megaparsec.Custom into Hledger.Utils.Parse 2024-06-25 18:37:54 +01:00
Regex.hs dev: cleanups 2024-10-20 09:13:58 -10:00
String.hs feat: config file: add a real parser, support command-specific options 2024-06-25 18:37:54 +01:00
Test.hs dev: refactor: merge Text.Megaparsec.Custom into Hledger.Utils.Parse 2024-06-25 18:37:54 +01:00
Text.hs imp:print:beancount: conversion improvements 2023-11-23 01:47:15 -10:00