Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal break down when I use python input() function. #16305

Closed
c2ray opened this issue Nov 14, 2023 · 9 comments
Closed

Terminal break down when I use python input() function. #16305

c2ray opened this issue Nov 14, 2023 · 9 comments
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news.

Comments

@c2ray
Copy link

c2ray commented Nov 14, 2023

Windows Terminal version

Lastest

Windows build number

22H2

Other Software

python3

Steps to reproduce

bandicam.2023-11-14.22-17-14-947.mp4

Expected Behavior

No response

Actual Behavior

It breaks down when I type something to python input() in windows terminal. It must be the keyword class.

@c2ray c2ray added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 14, 2023
@zadjii-msft
Copy link
Member

Huh, looks like the IME caused the Terminal to crash there. That's sure weird, but I bet the feedback hub should be able to get a dump from the crash: /feedback

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 14, 2023
@zadjii-msft zadjii-msft added Area-Input Related to input processing (key presses, mouse, etc.) Severity-Crash Crashes are real bad news. Product-Terminal The new Windows Terminal. labels Nov 14, 2023
@c2ray
Copy link
Author

c2ray commented Nov 14, 2023

Huh, looks like the IME caused the Terminal to crash there. That's sure weird, but I bet the feedback hub should be able to get a dump from the crash: /feedback

Submited feedback already.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Nov 14, 2023
@zadjii-msft
Copy link
Member

Can you make sure to share the aka.ms link that's generated from the "Share" button/? It's effectively impossible for us to find it without a direct link 😕

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Nov 14, 2023
@c2ray
Copy link
Author

c2ray commented Nov 15, 2023

Can you make sure to share the aka.ms link that's generated from the "Share" button/? It's effectively impossible for us to find it without a direct link 😕

Here's the link, https://aka.ms/AAnl6wm.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Nov 15, 2023
@carlos-zamora carlos-zamora added Priority-1 A description (P1) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Nov 15, 2023
@carlos-zamora carlos-zamora added this to the Terminal v1.20 milestone Nov 15, 2023
@zadjii-msft
Copy link
Member

Notes:

  • 19045.3086.vb_release
  • "Windows Terminal version: latest" - well, that's not a real version. There's like 5 "latest" versions floating around in different channels.
  • RUNNING_PROCESS_INFO with tag IsTextInputManagementServiceRunning, { "Tag": "IsTextInputManagementServiceRunning=false" }
  • {
       "version": 7,
       "providerName": "Microsoft.Windows.Terminal.Win32Host",
       "hresult": "2147943809",
       "fileName": "C:\\__w\\1\\s\\src\\cascadia\\WindowsTerminal\\WindowEmperor.cpp",
       "lineNumber": "703",
       "module": "WindowsTerminal.exe",
       "failureType": "2",
       "message": "",
       "threadId": "12652",
       "callContext": "",
       "originatingContextId": "0",
       "originatingContextName": "",
       "originatingContextMessage": "",
       "currentContextId": "0",
       "currentContextName": "",
       "currentContextMessage": ""
    }
    
    Okay that's just a ERROR_HOTKEY_ALREADY_REGISTERED that's nothing
  • There are three crashes and they're only conhost so that's useless.
  • The error message about the text input service not running sure is curious but I don't know enough about how the IME works to investigate.

You might need to file feedback under a different area path, but I dont know what actually tracks the IME code 🤷

@c2ray
Copy link
Author

c2ray commented Nov 16, 2023

Notes:

  • 19045.3086.vb_release

  • "Windows Terminal version: latest" - well, that's not a real version. There's like 5 "latest" versions floating around in different channels.

  • RUNNING_PROCESS_INFO with tag IsTextInputManagementServiceRunning, { "Tag": "IsTextInputManagementServiceRunning=false" }

  • {
       "version": 7,
       "providerName": "Microsoft.Windows.Terminal.Win32Host",
       "hresult": "2147943809",
       "fileName": "C:\\__w\\1\\s\\src\\cascadia\\WindowsTerminal\\WindowEmperor.cpp",
       "lineNumber": "703",
       "module": "WindowsTerminal.exe",
       "failureType": "2",
       "message": "",
       "threadId": "12652",
       "callContext": "",
       "originatingContextId": "0",
       "originatingContextName": "",
       "originatingContextMessage": "",
       "currentContextId": "0",
       "currentContextName": "",
       "currentContextMessage": ""
    }
    

    Okay that's just a that's nothingERROR_HOTKEY_ALREADY_REGISTERED

  • There are three crashes and they're only conhost so that's useless.

  • The error message about the text input service not running sure is curious but I don't know enough about how the IME works to investigate.

You might need to file feedback under a different area path, but I dont know what actually tracks the IME code 🤷

I updated my windows terminal to 1.18.3181.0. It still appears.

github-merge-queue bot pushed a commit that referenced this issue Apr 18, 2024
Next in the popular series of minor refactorings:
Out with the old, in with the new!

This PR removes all of the existing TSF code, both for conhost and
Windows Terminal. conhost's TSF implementation was awful:
It allocated an entire text buffer _per line_ of input.
Additionally, its implementation spanned a whopping 40 files and
almost 5000 lines of code. Windows Terminal's implementation was
absolutely fine in comparison, but it was user unfriendly due to
two reasons: Its usage of the `CoreTextServices` WinRT API indirectly
meant that it used a non-transitory TSF document, which is not the
right choice for a terminal. A `TF_SS_TRANSITORY` document (-context)
indicates to TSF that it cannot undo a previously completed composition
which is exactly what we need: Once composition has completed we send
the result to the shell and we cannot undo this later on.
The WinRT API does not allow us to use `TF_SS_TRANSITORY` and so it's
unsuitable for our application. Additionally, the implementation used
XAML to render the composition instead of being part of our text
renderer, which resulted in the text looking weird and hard to read.

The new implementation spans just 8 files and is ~1000 lines which
should make it significantly easier to maintain. The architecture is
not particularly great, but it's certainly better than what we had.
The implementation is almost entirely identical between both conhost
and Windows Terminal and thus they both also behave identical.
It fixes an uncountable number of subtle bugs in the conhost TSF
implementation, as it failed to check for status codes after calls.
It also adds several new features, like support for wavy underlines
(as used by the Japanese IME), dashed underlines (the default for
various languages now, like Vietnamese), colored underlines,
colored foreground/background controlled by the IME, and more!

I have tried to replicate the following issues and have a high
confidence that they're resolved now:
Closes #1304
Closes #3730
Closes #4052
Closes #5007  (as it is not applicable anymore)
Closes #5110
Closes #6186
Closes #6192
Closes #13805
Closes #14349
Closes #14407
Closes #16180

For the following issues I'm not entirely sure if it'll fix it,
but I suspect it's somewhat likely:
#13681
#16305
#16817

Lastly, there's one remaining bug that I don't know how to resolve.
However, that issue also plagues conhost and Windows Terminal
right now, so it's at least not a regression:
* Press Win+. (emoji picker) and close it
* Move the window around
* Press Win+.

This will open the emoji picker at the old window location.
It also occurs when the cursor moves within the window.
While this is super annoying, I could not find a way to fix it.

## Validation Steps Performed
* See the above closed issues
* Use Vietnamese Telex and type "xin choaf"
  Results in "xin chào" ✅
* Use the MS Japanese IME and press Alt+`
  Toggles between the last 2 modes ✅
* Use the MS Japanese IME, type "kyouhaishaheiku", and press Space
  * The text is converted, underlined and the first part is
    doubly underlined ✅
  * Left/Right moves between the 3 segments ✅
  * Home/End moves between start/end ✅
  * Esc puts a wavy line under the current segment ✅
* Use the Korean IME, type "gksgks"
  This results in "한한" ✅
* Use the Korean IME, type "gks", and press Right Ctrl
  Opens a popup which allows you to navigate with Arrow/Tab keys ✅
@lhecker
Copy link
Member

lhecker commented Apr 18, 2024

We just published a major update to our IME implementation in the nightly Canary branch. It was rewritten from the ground up and has tons of improvements! If you're interested in trying it out, you can get it here: https://aka.ms/terminal-canary-installer
If you already have the Canary build installed, you can use this link to force an update.

If you encounter any issues or have any suggestions, or if you simply like/dislike the changes, please let us know! Thank you for bearing with us. 😊

@lhecker lhecker added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 22, 2024
@lhecker
Copy link
Member

lhecker commented Aug 22, 2024

Please try Windows Terminal Preview v1.21 or later. As mentioned above, there's a new IME implementation. If the issue still occurs, let us know! Otherwise, the bot will close this issue in about a week. 🙂

@microsoft-github-policy-service microsoft-github-policy-service bot added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 26, 2024
Copy link
Contributor

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

No branches or pull requests

4 participants