Attach and detach commands use a spinner to communicate the status of the ongoing operation. If a potential conflict is found, such as attaching a Space that's already been attached, the user is prompted to confirm whether they want to proceed. The spinner overwrites that prompt because it's still active, so we work around that by making the spinner draw its own prompt. But the first prompt is briefly visible for a flash, and the spinner's prompt may be misleading about whether the default is to proceed or abort.
This PR updates attach and detach commands to disable the spinner while prompting the user. This relieves the spinner of needing to write its own prompt, allowing attach/detach to use the existing prompt which correctly indicates the default selection.
[x] Run make reviewable to ensure this PR is ready for review.
[x] Added backport release-x.y labels to auto-backport this PR, as appropriate.
How has this code been tested
I put together a gist with output from the attach/detach commands. There are two text files before.txt and after.txt showing output before and after this PR. Each shows:
successful attach
reattach of attached cluster, aborted
reattach of attached cluster, proceeding
successful detach
re-detach of detached cluster, aborted
re-detach of detached cluster, proceeding
For convenience there's also a diff.diff showing the diff between before.txt and after.txt.
Note that the spinner's prompt in before.txt isn't captured due to competition between the spinner and the overwritten confirmation prompt and ensuing terminal weirdness.
Description of your changes
Attach and detach commands use a spinner to communicate the status of the ongoing operation. If a potential conflict is found, such as attaching a Space that's already been attached, the user is prompted to confirm whether they want to proceed. The spinner overwrites that prompt because it's still active, so we work around that by making the spinner draw its own prompt. But the first prompt is briefly visible for a flash, and the spinner's prompt may be misleading about whether the default is to proceed or abort.
This PR updates attach and detach commands to disable the spinner while prompting the user. This relieves the spinner of needing to write its own prompt, allowing attach/detach to use the existing prompt which correctly indicates the default selection.
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
I put together a gist with output from the attach/detach commands. There are two text files
before.txt
andafter.txt
showing output before and after this PR. Each shows:For convenience there's also a
diff.diff
showing the diff betweenbefore.txt
andafter.txt
.Note that the spinner's prompt in
before.txt
isn't captured due to competition between the spinner and the overwritten confirmation prompt and ensuing terminal weirdness.