Commit f4a5adf4 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: Output a newline when interrupted for UI

parent e0b05355
...@@ -134,7 +134,13 @@ func (rw *ReaderWriterUi) Ask(query string) (string, error) { ...@@ -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")
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment