Text input overlays text existing instead of inserting correctly #5819

Closed
opened 2026-01-31 00:22:35 +00:00 by claunia · 15 comments
Owner

Originally created by @sinister3vil on GitHub (Jan 8, 2020).

Environment

Windows build number: Microsoft Windows NT 10.0.18362.0
Windows Terminal version (if applicable):  0.7.3451.0

Steps to reproduce

When making corrections/inserting text, new text overlays over existing. This is clearly graphical, actual text sent is correct.
This seems to be related to the text color. The most sure fire way reproduce is SSHing into Mikrotik RouterOS, where any input gets themed. Also happens in WSL, but haven't been able to reproduce effectively.

Below video better illustrates this.

https://www.youtube.com/watch?v=OkkZhDAl8sU

Expected behavior

Text should not overlay.

Actual behavior

Text gets overlayed.

Extra notes

This seems to be conhost related.
Using the latest version of Terminus (https://github.com/Eugeny/terminus) with conPTY enabled does not produce this bug. Disabling conPTY results in this bug.
Built-in windows consoles like cmd or powershell also have this issue.
Non-console apps like PuTTY or MinTTY do not produce this bug.

Originally created by @sinister3vil on GitHub (Jan 8, 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: Microsoft Windows NT 10.0.18362.0 Windows Terminal version (if applicable): 0.7.3451.0 ``` # Steps to reproduce When making corrections/inserting text, new text overlays over existing. This is clearly graphical, actual text sent is correct. This seems to be related to the text color. The most sure fire way reproduce is SSHing into Mikrotik RouterOS, where any input gets themed. Also happens in WSL, but haven't been able to reproduce effectively. Below video better illustrates this. https://www.youtube.com/watch?v=OkkZhDAl8sU # Expected behavior Text should not overlay. # Actual behavior Text gets overlayed. # Extra notes This seems to be conhost related. Using the latest version of Terminus (https://github.com/Eugeny/terminus) with conPTY enabled does not produce this bug. Disabling conPTY results in this bug. Built-in windows consoles like cmd or powershell also have this issue. Non-console apps like PuTTY or MinTTY do not produce this bug.
Author
Owner

@zadjii-msft commented on GitHub (Jan 9, 2020):

To help debug this, let's just focus on the conhost (cmd/powershell) and none of the other terminal applications, as they might complicate the repro.

  • Which shell application are you running on the Mikrotik RouterOS machine? bash, zsh, pwsh, etc
    • do you have any extra config for that shell application that might be relevant?
  • While ssh'd, could you share the output of infocmp and stty -a?
@zadjii-msft commented on GitHub (Jan 9, 2020): To help debug this, let's just focus on the conhost (cmd/powershell) and none of the other terminal applications, as they might complicate the repro. * Which shell application are you running on the Mikrotik RouterOS machine? `bash`, `zsh`, `pwsh`, etc - do you have any extra config for that shell application that might be relevant? * While ssh'd, could you share the output of `infocmp` and `stty -a`?
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 9, 2020):

I believe this is just a known limitation of Terminal's current TSF text input control.

Instead of inserting your typed characters into the terminal with the other text, it displays them on a layer on top of the terminal. It hasn't been updated to properly update the text underneath it.

@DHowett-MSFT commented on GitHub (Jan 9, 2020): I believe this is just a known limitation of Terminal's current TSF text input control. Instead of inserting your typed characters into the terminal with the other text, it displays them on a layer on top of the terminal. It hasn't been updated to properly update the text underneath it.
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 9, 2020):

image

and if you're using "retro", you can see how the little input box doesn't match the rest of the terminal 😄

image

@DHowett-MSFT commented on GitHub (Jan 9, 2020): ![image](https://user-images.githubusercontent.com/14316954/72096292-c6e88380-32ce-11ea-8daf-c9e611ef1db6.png) and if you're using "retro", you can see how the little input box doesn't match the rest of the terminal :smile: ![image](https://user-images.githubusercontent.com/14316954/72096323-d962bd00-32ce-11ea-95d9-353e0902e3dc.png)
Author
Owner

@sinister3vil commented on GitHub (Jan 9, 2020):

To help debug this, let's just focus on the conhost (cmd/powershell) and none of the other terminal applications, as they might complicate the repro.

  • Which shell application are you running on the Mikrotik RouterOS machine? bash, zsh, pwsh, etc

    • do you have any extra config for that shell application that might be relevant?
  • While ssh'd, could you share the output of infocmp and stty -a?

Hello zadjii-msft,

While RouterOS is based on linux they have they're own shell implementation which does not allow normal *nix commands.

I believe this is just a known limitation of Terminal's current TSF text input control.

Instead of inserting your typed characters into the terminal with the other text, it displays them on a layer on top of the terminal. It hasn't been updated to properly update the text underneath it.

Just want to point out that it's not just the Terminal, as in Windows Terminal, but any terminal that uses conhost, to the best of my understanding.

Also want to point out that this seems to have started after the May 2019 Windows update, which I got during the summer, July or so.

Apologies for not being more helpful, being able to only casually reproduce this on Mikrotiks surely limits your ability to further debug the issue. I've also seen it on bash, on occasion, though I'm not sure where, but it was surely when running a terminal app that does it's own syntax highlighting on the input.

PS, you can fool around on a RouterOS shell here, if you believe it can help :
ssh demo@demo.mt.lv
(provided by Mikrotik)

@sinister3vil commented on GitHub (Jan 9, 2020): > To help debug this, let's just focus on the conhost (cmd/powershell) and none of the other terminal applications, as they might complicate the repro. > > * Which shell application are you running on the Mikrotik RouterOS machine? `bash`, `zsh`, `pwsh`, etc > > * do you have any extra config for that shell application that might be relevant? > * While ssh'd, could you share the output of `infocmp` and `stty -a`? Hello zadjii-msft, While RouterOS is based on linux they have they're own shell implementation which does not allow normal *nix commands. > I believe this is just a known limitation of Terminal's current TSF text input control. > > Instead of inserting your typed characters into the terminal with the other text, it displays them on a layer on top of the terminal. It hasn't been updated to properly update the text underneath it. Just want to point out that it's not just the Terminal, as in Windows Terminal, but any terminal that uses conhost, to the best of my understanding. Also want to point out that this seems to have started after the May 2019 Windows update, which I got during the summer, July or so. Apologies for not being more helpful, being able to only casually reproduce this on Mikrotiks surely limits your ability to further debug the issue. I've also seen it on bash, on occasion, though I'm not sure where, but it was surely when running a terminal app that does it's own syntax highlighting on the input. PS, you can fool around on a RouterOS shell here, if you believe it can help : ssh demo@demo.mt.lv (provided by Mikrotik)
Author
Owner

@sinister3vil commented on GitHub (Jan 9, 2020):

Just wanted to add that by logging in as demo+c@demo.mt.tv it will disable all colors in the shell, and then the issue is more apparent, any text typed gets overlayed, so I'm guessing it has something to do with how "white" text is handled.

@sinister3vil commented on GitHub (Jan 9, 2020): Just wanted to add that by logging in as demo+c@demo.mt.tv it will disable all colors in the shell, and then the issue is more apparent, any text typed gets overlayed, so I'm guessing it has something to do with how "white" text is handled.
Author
Owner

@awachowiak commented on GitHub (Nov 16, 2020):

Do we have any progress regarding this issue? I'm having same problem when connecting via ssh to remote server, using bash shell.

@awachowiak commented on GitHub (Nov 16, 2020): Do we have any progress regarding this issue? I'm having same problem when connecting via ssh to remote server, using bash shell.
Author
Owner

@niedzwiedzislaw commented on GitHub (Jan 29, 2021):

Just to make this more baffling, I'll add my findings.

  • No issues on laptop with windows version 1909 and terminal 1.5

  • No issues on laptop with windows 20H2 and terminal 1.4 and 1.5

  • But then issues on PC with the same versions....

  • No issues with PowerShell

  • Issues with CMD and WSL

  • Commands without a space are safe to edit

  • If command contains a space then text overlapping happens on parts before last space. Last word is safe to edit.

  • However, irrespectively of cursor position, you can safely add letter which is after the cursor.
    Truly mysterious this behaviour is.

@niedzwiedzislaw commented on GitHub (Jan 29, 2021): Just to make this more baffling, I'll add my findings. - No issues on laptop with windows version 1909 and terminal 1.5 - No issues on laptop with windows 20H2 and terminal 1.4 and 1.5 - But then issues on PC with the same versions.... - No issues with PowerShell - Issues with CMD and WSL - Commands without a space are safe to edit - If command contains a space then text overlapping happens on parts before last space. Last word is safe to edit. - However, irrespectively of cursor position, you can safely add letter which is after the cursor. Truly mysterious this behaviour is.
Author
Owner

@awachowiak commented on GitHub (Feb 1, 2021):

I've managed to diagnose this issue. In my case it was happening only when connection to remote server via ssh.
On remote machine, inside .profile file, was line export TERM="xterm-color". Removing this line solved problem.

No more input overlay :)

@awachowiak commented on GitHub (Feb 1, 2021): I've managed to diagnose this issue. In my case it was happening only when connection to remote server via ssh. On remote machine, inside `.profile` file, was line `export TERM="xterm-color"`. Removing this line solved problem. No more input overlay :)
Author
Owner

@niedzwiedzislaw commented on GitHub (Feb 1, 2021):

Now that you mention it, my broken terminals have TERM="xterm-color". My working terminals have TERM="xterm-256color". Thanks.

@niedzwiedzislaw commented on GitHub (Feb 1, 2021): Now that you mention it, my broken terminals have TERM="xterm-color". My working terminals have TERM="xterm-256color". Thanks.
Author
Owner

@zadjii-msft commented on GitHub (Dec 9, 2021):

Hey sorry this one sat on the backlog for so long. @sinister3vil you still seeing this? If so, did the remote machine have TERM=xterm-color set? Does removing that fix it?

@zadjii-msft commented on GitHub (Dec 9, 2021): Hey sorry this one sat on the backlog for so long. @sinister3vil you still seeing this? If so, did the remote machine have `TERM=xterm-color` set? Does removing that fix it?
Author
Owner

@DHowett commented on GitHub (Dec 9, 2021):

That's weird. TERM should not be able to change this behavior! This is a well known issue in our IME implementation.

@DHowett commented on GitHub (Dec 9, 2021): That's weird. `TERM` should not be able to change this behavior! This is a well known issue in our IME implementation.
Author
Owner

@zadjii-msft commented on GitHub (Dec 9, 2021):

@DHowett looking at the original bug, I'm not sure there's any IME involved here. When we're proposing text via the IME, there's usually a tiny little underline, but that's not in this video at all.

@zadjii-msft commented on GitHub (Dec 9, 2021): @DHowett looking at the original bug, I'm not sure there's any IME involved here. When we're proposing text via the IME, there's usually a tiny little underline, but that's not in this video at all.
Author
Owner

@ghost commented on GitHub (Dec 13, 2021):

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 (Dec 13, 2021): 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**.
Author
Owner

@sinister3vil commented on GitHub (Dec 14, 2021):

Hey sorry this one sat on the backlog for so long. @sinister3vil you still seeing this? If so, did the remote machine have TERM=xterm-color set? Does removing that fix it?

Hello @zadjii-msft, unfortunately I don't have access to a windows system any more to test it.
Still, imho, even if the issue was the terminal type set to xterm-color, which I cannot confirm for RouterOS, the terminal should work as expected with that type and just use an 8-color palette.

@sinister3vil commented on GitHub (Dec 14, 2021): > Hey sorry this one sat on the backlog for so long. @sinister3vil you still seeing this? If so, did the remote machine have `TERM=xterm-color` set? Does removing that fix it? Hello @zadjii-msft, unfortunately I don't have access to a windows system any more to test it. Still, imho, even if the issue was the terminal type set to xterm-color, which I cannot confirm for RouterOS, the terminal should work as expected with that type and just use an 8-color palette.
Author
Owner

@zadjii-msft commented on GitHub (Dec 14, 2021):

I'm playing around with the demo link you sent, and frankly I have no idea how to get the TERM out of that. I'd suspect that they're not even using TERM, since it doesn't seem to really be running a typical shell like bash or fish, it's some specific use shell.

I also can't get anything like the OP to occur anymore, which makes me think that the original bug was probably fixed sometime in the last two years. Thanks for filing this! Sorry there's not a more specific resolution here.

@zadjii-msft commented on GitHub (Dec 14, 2021): I'm playing around with the demo link you sent, and frankly I have no idea how to get the TERM out of that. I'd suspect that they're not even using TERM, since it doesn't seem to really be running a typical shell like `bash` or `fish`, it's some specific use shell. I also can't get anything like the OP to occur anymore, which makes me think that the original bug was probably fixed sometime in the last two years. Thanks for filing this! Sorry there's not a more specific resolution here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5819