fix:cli:paging: support older less, don't pass --use-color [#2335]

Older less versions (eg 551) require --use-colour, and break if --use-color is passed. So we no longer attempt to enable colour in less by default.
This commit is contained in:
Simon Michael 2025-03-04 16:32:31 -10:00
parent f450379229
commit cb373447db
2 changed files with 1 additions and 3 deletions

View File

@ -468,7 +468,6 @@ getTerminalWidth = fmap snd <$> getTerminalHeightWidth
-- --shift=8
-- --squeeze-blank-lines
-- --use-backslash
-- --use-color
--
-- You can choose different options by setting the HLEDGER_LESS variable;
-- if set, its value will be used instead of LESS.
@ -491,7 +490,7 @@ setupPager = do
,"--shift=8"
,"--squeeze-blank-lines"
,"--use-backslash"
,"--use-color"
-- ,"--use-color" #2335 rejected by older less versions (eg 551)
]
mhledgerless <- lookupEnv "HLEDGER_LESS"
mless <- lookupEnv "LESS"

View File

@ -790,7 +790,6 @@ to enable ANSI colour and a number of other conveniences.
--shift=8
--squeeze-blank-lines
--use-backslash
--use-color
).
If these don't work well, you can set your preferred options in the `HLEDGER_LESS` variable, which will be used instead.