parent
74ffbfd9ba
commit
f01208af3b
|
@ -13,6 +13,8 @@ CHANGELOG
|
|||
|
||||
- Ensure Python overlays work as part of our SDK generation
|
||||
[#4043](https://github.com/pulumi/pulumi/pull/4043)
|
||||
- Fix terminal gets into a state where UP/DOWN don't work with prompts.
|
||||
[#4042](https://github.com/pulumi/pulumi/pull/4042)
|
||||
|
||||
- Ensure old provider is not used when configuration has changed
|
||||
[#4051](https://github.com/pulumi/pulumi/pull/4051)
|
||||
|
|
|
@ -745,6 +745,8 @@ func chooseTemplate(templates []workspace.Template, opts display.Options) (works
|
|||
continue
|
||||
}
|
||||
|
||||
cmdutil.EndKeypadTransmitMode()
|
||||
|
||||
var option string
|
||||
if err := survey.AskOne(&survey.Select{
|
||||
Message: message,
|
||||
|
|
|
@ -197,6 +197,8 @@ func choosePolicyPackTemplate(templates []workspace.PolicyPackTemplate,
|
|||
|
||||
options, optionToTemplateMap := policyTemplatesToOptionArrayAndMap(templates)
|
||||
|
||||
cmdutil.EndKeypadTransmitMode()
|
||||
|
||||
var option string
|
||||
if err := survey.AskOne(&survey.Select{
|
||||
Message: message,
|
||||
|
|
|
@ -98,6 +98,8 @@ func locateStackResource(opts display.Options, snap *deploy.Snapshot, urn resour
|
|||
optionMap[message] = ambiguousResource
|
||||
}
|
||||
|
||||
cmdutil.EndKeypadTransmitMode()
|
||||
|
||||
var option string
|
||||
if err := survey.AskOne(&survey.Select{
|
||||
Message: prompt,
|
||||
|
@ -146,6 +148,7 @@ func runTotalStateEdit(
|
|||
surveycore.SelectFocusIcon = opts.Color.Colorize(colors.BrightGreen + ">" + colors.Reset)
|
||||
prompt := opts.Color.Colorize(colors.Yellow + "warning" + colors.Reset + ": ")
|
||||
prompt += "This command will edit your stack's state directly. Confirm?"
|
||||
cmdutil.EndKeypadTransmitMode()
|
||||
if err = survey.AskOne(&survey.Confirm{
|
||||
Message: prompt,
|
||||
}, &confirm, nil); err != nil || !confirm {
|
||||
|
|
|
@ -290,6 +290,8 @@ func chooseStack(
|
|||
}
|
||||
message = opts.Color.Colorize(colors.SpecPrompt + message + colors.Reset)
|
||||
|
||||
cmdutil.EndKeypadTransmitMode()
|
||||
|
||||
var option string
|
||||
if err = survey.AskOne(&survey.Select{
|
||||
Message: message,
|
||||
|
|
|
@ -18,6 +18,7 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/pulumi/pulumi/pkg/util/cmdutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
|
@ -161,6 +162,8 @@ func confirmBeforeUpdating(kind apitype.UpdateKind, stack Stack,
|
|||
colors.Reset)
|
||||
}
|
||||
|
||||
cmdutil.EndKeypadTransmitMode()
|
||||
|
||||
// Now prompt the user for a yes, no, or details, and then proceed accordingly.
|
||||
if err := survey.AskOne(&survey.Select{
|
||||
Message: prompt,
|
||||
|
|
|
@ -95,6 +95,16 @@ func RemoveTrailingNewline(s string) string {
|
|||
return s
|
||||
}
|
||||
|
||||
// EndKeypadTransmitMode switches the terminal out of the keypad transmit 'application' mode back to 'normal' mode.
|
||||
func EndKeypadTransmitMode() {
|
||||
if runtime.GOOS != "windows" && Interactive() {
|
||||
// Print an escape sequence to switch the keypad mode, same as 'tput rmkx'.
|
||||
// Work around https://github.com/pulumi/pulumi/issues/3480.
|
||||
// A better fix might be fixing upstream https://github.com/AlecAivazis/survey/issues/228.
|
||||
fmt.Print("\033[?1l")
|
||||
}
|
||||
}
|
||||
|
||||
type Table struct {
|
||||
Headers []string
|
||||
Rows []TableRow // Rows of the table.
|
||||
|
|
Loading…
Reference in a new issue