-
Notifications
You must be signed in to change notification settings - Fork 90
bug: apm init asks "Continue and overwrite?" three times on Windows CP950 terminals #602
Copy link
Copy link
Open
Description
Description
On Windows systems with a non-UTF-8 console encoding (CP950, CP936, CP932), running apm init in a project that already has an apm.yml shows the overwrite confirmation prompt three times before accepting the answer.
Steps to Reproduce
- Set up a Windows machine with a CJK locale (e.g. Traditional Chinese, CP950)
- Create an APM project:
apm init my-project - Run
apm init my-projecta second time - Type
nand press Enter
Actual Behaviour
[!] apm.yml already exists
Continue and overwrite? [y/n]: n
[!] apm.yml already exists
Continue and overwrite? [y/n]: n
Continue and overwrite? [y/n]: n
[i] Initialization cancelled.
Expected Behaviour
The prompt appears once and the command exits cleanly.
Root Cause
init.py uses Rich Confirm.ask() wrapped in a try/except that falls back to click.confirm(). On CP950 terminals, Rich fails to decode the input, retries internally, then raises an exception — at which point the except block calls click.confirm() again. The user is asked three times.
Environment
- OS: Windows 11, console code page CP950
- apm version: v0.8.11
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels