aws-amplify / aws-amplify/amplify-cli

Issue with cursor during prompt in `amplify import auth` flow on Windows with PowerShell 5.1

Open
#9,940 0 comments 0 reactions 0 assignees View on GitHub
auth bug import p3 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

v14.18.0

### Amplify CLI Version

v7.6.23

### What operating system are you using?

mac

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

n/a

### Amplify Categories

auth

### Amplify Commands

Not applicable

### Describe the bug

When importing an existing auth resource on Windows with PowerShell 5.1 we are prompted to select the web and native clients. For the native app client prompt we are unable to use the arrow keys to select a client, however if we hit Enter the cursor enters the list field which then allows us to use arrow keys and select an app client with Enter. In short, to select a native app client we are required to hit Enter twice.

```
PS C:\Users\josef\Documents\importauth> amplify import auth
Using service: Cognito, provided by: awscloudformation
√ What type of auth resource do you want to import? · Cognito User Pool and Identity Pool
√ Select the User Pool you want to import: · us-east-1_mJpRMopaK
The User Pool has multiple Web app clients configured.
√ Select a Web client to import: · 1v6na80hrdoss9phd4spj5erd9
The User Pool has multiple Native app clients configured.
? Select a Native client to import: ...
√ Select a Native client to import: · 31la5qljkpqbvmhirkpo15oua9
```

For reference https://github.com/aws-amplify/amplify-cli/blob/8483c7922c94d820e8a6c2d61465712a6b34c8fb/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts#L413

### Expected behavior

Native app client prompt behaves the same as Web app client, where we are immediately allowed to use arrow keys and select a client

### Reproduction steps

On Windows with PowerShell 5.1:

1. create a new project with `amplify init -y`
2. import auth with `amplify import auth`
3. select an existing auth resource with multiple app clients configured
4. select a web app client
5. attempt to select a native app client
6. observe cursor issue

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at packages/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts around line 413, then reproduce amplify import auth on Windows with PowerShell 5.1 using a user pool with multiple web and native clients. Compare the native client prompt with the web client prompt; done means native selection accepts arrow keys immediately and requires only one Enter.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript
Domain
authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.