packer: Output a newline when interrupted for UI

This commit is contained in:
Mitchell Hashimoto 2013-06-17 11:40:57 -07:00
parent e0b05355c3
commit f4a5adf471
1 changed files with 6 additions and 0 deletions

View File

@ -134,7 +134,13 @@ func (rw *ReaderWriterUi) Ask(query string) (string, error) {
case line := <-result:
return line, nil
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
return "", errors.New("interrupted")
}
}