fix: ignore 0 size terminals

This commit is contained in:
Jan De Dobbeleer 2021-05-25 18:31:23 +02:00 committed by Jan De Dobbeleer
parent e8062af1bb
commit 2cf288e46c

View file

@ -28,7 +28,7 @@ func (e *engine) string() string {
func (e *engine) canWriteRPrompt() bool { func (e *engine) canWriteRPrompt() bool {
prompt := e.string() prompt := e.string()
consoleWidth, err := e.env.getTerminalWidth() consoleWidth, err := e.env.getTerminalWidth()
if err != nil { if err != nil || consoleWidth == 0 {
return true return true
} }
promptWidth := e.ansi.lenWithoutANSI(prompt) promptWidth := e.ansi.lenWithoutANSI(prompt)