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 {
prompt := e.string()
consoleWidth, err := e.env.getTerminalWidth()
if err != nil {
if err != nil || consoleWidth == 0 {
return true
}
promptWidth := e.ansi.lenWithoutANSI(prompt)