commands: handle ctrl-c on active prompt by tonistiigi · Pull Request #2289 · docker/buildx (original) (raw)
fix #2240
With recent changes, the global cobra context is passed to all commands what usually is correct, but in this case the prompt library does not provide support for cancellation.
Note that although the new function supports cancellation, it does not leave the reader in a clean state. Internally the prompt function uses bufio reader so it is unknown how many bytes it has read and how much data it has dropped once the prompt function returns.