Commit 22e73451 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: Ui requires input for Ctrl-C

parent 4c1873d1
...@@ -210,7 +210,6 @@ func (c Command) Run(env packer.Environment, args []string) int { ...@@ -210,7 +210,6 @@ func (c Command) Run(env packer.Environment, args []string) int {
} }
} }
// Wait for both the builds to complete and the interrupt handler, // Wait for both the builds to complete and the interrupt handler,
// if it is interrupted. // if it is interrupted.
log.Printf("Waiting on builds to complete...") log.Printf("Waiting on builds to complete...")
......
...@@ -124,14 +124,18 @@ func (rw *ReaderWriterUi) Ask(query string) string { ...@@ -124,14 +124,18 @@ func (rw *ReaderWriterUi) Ask(query string) string {
result <- line result <- line
}() }()
select { for {
case line := <-result: select {
return line case line := <-result:
case <-sigCh: return line
log.Println("Interrupt during Ask call. Returning immediately.") case <-sigCh:
fmt.Fprintln(rw.Writer) fmt.Fprint(
return "" rw.Writer,
"\nInterrupts are blocked while waiting for input. Press enter.")
}
} }
return ""
} }
func (rw *ReaderWriterUi) Say(message string) { func (rw *ReaderWriterUi) Say(message string) {
......
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