handle when getTermCols returns 0
This commit is contained in:
parent
f58fa5218f
commit
da3cd404f3
1 changed files with 7 additions and 1 deletions
|
@ -40,6 +40,12 @@ record Options where
|
|||
%name Options opts
|
||||
%runElab derive "Options" [Show]
|
||||
|
||||
export
|
||||
defaultWidth : IO Nat
|
||||
defaultWidth = do
|
||||
w <- cast {to = Nat} <$> getTermCols
|
||||
pure $ if w == 0 then 80 else w
|
||||
|
||||
export
|
||||
defaultOpts : IO Options
|
||||
defaultOpts = pure $ MkOpts {
|
||||
|
@ -47,7 +53,7 @@ defaultOpts = pure $ MkOpts {
|
|||
outFile = Console,
|
||||
until = Nothing,
|
||||
flavor = Unicode,
|
||||
width = cast !getTermCols,
|
||||
width = !defaultWidth,
|
||||
include = ["."]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue