packer: Output a newline when interrupted for UI
This commit is contained in:
parent
e0b05355c3
commit
f4a5adf471
|
@ -134,7 +134,13 @@ func (rw *ReaderWriterUi) Ask(query string) (string, error) {
|
||||||
case line := <-result:
|
case line := <-result:
|
||||||
return line, nil
|
return line, nil
|
||||||
case <-sigCh:
|
case <-sigCh:
|
||||||
|
// Print a newline so that any further output starts properly
|
||||||
|
// on a new line.
|
||||||
|
fmt.Fprintln(rw.Writer)
|
||||||
|
|
||||||
|
// Mark that we were interrupted so future Ask calls fail.
|
||||||
rw.interrupted = true
|
rw.interrupted = true
|
||||||
|
|
||||||
return "", errors.New("interrupted")
|
return "", errors.New("interrupted")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue