Some characters can not be recongized by Python shell in docker #11536

Closed
opened 2026-01-31 02:50:28 +00:00 by claunia · 4 comments
Owner

Originally created by @skyline75489 on GitHub (Nov 22, 2020).

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] 10.0.19041.572
Windows Terminal version (if applicable): master on 67dfbd21a6b37025ebc0cc435c2ddf791e32811a

Any other software?

Docker

Steps to reproduce

Using Python installed by apt install python3 in a ubuntu:18.04 docker image, and Microsoft Chinese IME, type 中文 in Chinese mode in Python shell.

Expected behavior

It works

Actual behavior

Something weird happens:

image

It feels like I'm using and alt + something.

And I'm using (a Chinese '), sometimes nothing happens. Somethings it feels like I'm typing a ( (and backwards):

image

It actually works in Python provided by anaconda:

image

Originally created by @skyline75489 on GitHub (Nov 22, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] 10.0.19041.572 Windows Terminal version (if applicable): master on 67dfbd21a6b37025ebc0cc435c2ddf791e32811a Any other software? ``` Docker # Steps to reproduce Using Python installed by `apt install python3` in a `ubuntu:18.04` docker image, and Microsoft Chinese IME, type `中文` in Chinese mode in Python shell. <!-- A description of how to trigger this bug. --> # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> It works # Actual behavior Something weird happens: ![image](https://user-images.githubusercontent.com/4710575/99894339-228ce700-2cbe-11eb-989f-02daca917777.png) It feels like I'm using and `alt` + something. And I'm using `’` (a Chinese `'`), sometimes nothing happens. Somethings it feels like I'm typing a `(` (and backwards): ![image](https://user-images.githubusercontent.com/4710575/99894437-74ce0800-2cbe-11eb-8ddd-8e202bac5597.png) It actually works in Python provided by anaconda: ![image](https://user-images.githubusercontent.com/4710575/99893697-b5c51d00-2cbc-11eb-859f-03d07ba9ae8b.png) <!-- What's actually happening? -->
Author
Owner

@skyline75489 commented on GitHub (Nov 22, 2020):

I found some similarity in #7589 , however I'm not sure it's the same thing. I found in convert.cpp, there's CharToKeyEvents which will convert 中文 into alt + 中文, which I do not fully understand.

@skyline75489 commented on GitHub (Nov 22, 2020): I found some similarity in #7589 , however I'm not sure it's the same thing. I found in `convert.cpp`, there's `CharToKeyEvents` which will convert `中文` into `alt` + `中文`, which I do not fully understand.
Author
Owner

@skyline75489 commented on GitHub (Nov 22, 2020):

OK, I've tried this with Guake on Linux. It behaves exactly the same. Now that I think of it, perhaps I should not expect dockered Python without UTF-8 support to naturally accept UTF-8 content.

@skyline75489 commented on GitHub (Nov 22, 2020): OK, I've tried this with Guake on Linux. It behaves exactly the same. Now that I think of it, perhaps I should not expect dockered Python without UTF-8 support to naturally accept UTF-8 content.
Author
Owner

@zadjii-msft commented on GitHub (Nov 23, 2020):

I've tried this with Guake on Linux. It behaves exactly the same

So, presumably that would mean this is an external bug, yea?

@zadjii-msft commented on GitHub (Nov 23, 2020): > I've tried this with Guake on Linux. It behaves exactly the same So, presumably that would mean this is an external bug, yea?
Author
Owner

@ghost commented on GitHub (Nov 27, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Nov 27, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11536