Buggy output display #18779

Closed
opened 2026-01-31 06:24:03 +00:00 by claunia · 9 comments
Owner

Originally created by @vertigo220 on GitHub (Oct 29, 2022).

Windows Terminal version

1.15.2874.0

Windows build number

Version 21H2 (OS Build 19044.2006)

Other Software

No response

Steps to reproduce

Not really sure what's going on here, but I've noticed issues before with the output getting messed up in Terminal in ways I've not experienced with Command Prompt or PowerShell. This is just one example, which happened in the past day, so I'll just provide a screenshot with red outlines over areas that are messed up and explanations of each, and hopefully somebody can figure out why this is happening, since it makes Terminal pretty much useless if users can't see an accurate command and output history. I'm fairly certain that when this happens, including this time, there usually aren't any issues initially, i.e. when the commands are issued, but rather when going back and looking at them later things are messed up, though in some cases it does happen in real-time.

The first commands I issued in this instance were as follows:

$var1="setup-v2.6.174.0"
$var2="BthPS32.6.174"
if ("$var2" -like "*$var1*") {echo 1; $var = ($var1 -split 'v?(.*)')[1]} else {if ("$var2" -match ($var1 -split '(\d.*\d)')[1]) {echo 2; $var = ($var1 -split '(\d.*\d)')[1]} else {if ("$var2" -match ($var1 -split '(\d[\d\.]*)\D*')[1]) {echo 3; $var = ($var1 -split '(\d\S*)\s*')[1]} else {if ($var2.replace('.','') -match ($var1 -split '(\d.*\d)')[1]) {echo 4; $dig_first = ($var1 -split '(\d)')[1]; $dig_last = ($var1 -split '.*(\d)')[1]; $var = ($var2 -split ".*[\sv-]($dig_first.*$dig_last)")[1]} else {if ($var2.replace('.','') -match ($var1 -split '(\d[\d\.]*)\D')[1]) {echo 5; $dig_first = ($var1 -split '(\d)')[1]; $dig_last = ($var1 -split '.*(\d)')[1]; $var = ($var2 -split ".*[\sv-]($dig_first.*$dig_last)")[1]} else {echo "no match (1)"; $var = ""}}}}};
$var1="BthPS3 Bluetooth Drivers v2.6.174"

As you can see, the first command isn't even there, and after the second command there's no prompt and the beginning of the third command is cut off (so the prompt and the first 96 characters are missing). The next box shows that the output from the command is missing entirely, going straight from the input of the command to the next prompt. Next you can see it shows the output of a command (an empty line, the number 3, another empty line, the number 2.6, then the number 174) and then immediately shows the output of one or two other commands despite the commands themselves not showing. Finally, there's the command "$var2" which I entered, at which point it displayed the variable's contents, but then when I went to repeat a previous command from history, it put "$var2" on the command line again and I couldn't get rid of it, and it showed the history commands as I cycled through them on the next line with empty space where the prompt normally is (this happened as I was doing it).

So trying to scroll up to look back at what I've done and the results each command has given me and what each variable was set to along the way is impossible, since things are cut off or completely left out. It's unusable like this and means I need to stick with the standard terminals to get any serious work done.

Screenshot_22-10-29_13 15 34-WindowsTerminal

Expected Behavior

No response

Actual Behavior

See above

Originally created by @vertigo220 on GitHub (Oct 29, 2022). ### Windows Terminal version 1.15.2874.0 ### Windows build number Version 21H2 (OS Build 19044.2006) ### Other Software _No response_ ### Steps to reproduce Not really sure what's going on here, but I've noticed issues before with the output getting messed up in Terminal in ways I've not experienced with Command Prompt or PowerShell. This is just one example, which happened in the past day, so I'll just provide a screenshot with red outlines over areas that are messed up and explanations of each, and hopefully somebody can figure out why this is happening, since it makes Terminal pretty much useless if users can't see an accurate command and output history. I'm fairly certain that when this happens, including this time, there usually aren't any issues initially, i.e. when the commands are issued, but rather when going back and looking at them later things are messed up, though in some cases it does happen in real-time. The first commands I issued in this instance were as follows: ``` $var1="setup-v2.6.174.0" $var2="BthPS32.6.174" if ("$var2" -like "*$var1*") {echo 1; $var = ($var1 -split 'v?(.*)')[1]} else {if ("$var2" -match ($var1 -split '(\d.*\d)')[1]) {echo 2; $var = ($var1 -split '(\d.*\d)')[1]} else {if ("$var2" -match ($var1 -split '(\d[\d\.]*)\D*')[1]) {echo 3; $var = ($var1 -split '(\d\S*)\s*')[1]} else {if ($var2.replace('.','') -match ($var1 -split '(\d.*\d)')[1]) {echo 4; $dig_first = ($var1 -split '(\d)')[1]; $dig_last = ($var1 -split '.*(\d)')[1]; $var = ($var2 -split ".*[\sv-]($dig_first.*$dig_last)")[1]} else {if ($var2.replace('.','') -match ($var1 -split '(\d[\d\.]*)\D')[1]) {echo 5; $dig_first = ($var1 -split '(\d)')[1]; $dig_last = ($var1 -split '.*(\d)')[1]; $var = ($var2 -split ".*[\sv-]($dig_first.*$dig_last)")[1]} else {echo "no match (1)"; $var = ""}}}}}; $var1="BthPS3 Bluetooth Drivers v2.6.174" ``` As you can see, the first command isn't even there, and after the second command there's no prompt and the beginning of the third command is cut off (so the prompt and the first 96 characters are missing). The next box shows that the output from the command is missing entirely, going straight from the input of the command to the next prompt. Next you can see it shows the output of a command (an empty line, the number 3, another empty line, the number 2.6, then the number 174) and then immediately shows the output of one or two other commands despite the commands themselves not showing. Finally, there's the command "$var2" which I entered, at which point it displayed the variable's contents, but then when I went to repeat a previous command from history, it put "$var2" on the command line again and I couldn't get rid of it, and it showed the history commands as I cycled through them on the next line with empty space where the prompt normally is (this happened as I was doing it). So trying to scroll up to look back at what I've done and the results each command has given me and what each variable was set to along the way is impossible, since things are cut off or completely left out. It's unusable like this and means I need to stick with the standard terminals to get any serious work done. ![Screenshot_22-10-29_13 15 34-WindowsTerminal](https://user-images.githubusercontent.com/12024557/198848841-05984f87-9878-4287-81fb-d2df01edb9d6.png) ### Expected Behavior _No response_ ### Actual Behavior See above
Author
Owner

@zadjii-msft commented on GitHub (Oct 31, 2022):

Do you have anything in your powershell $profile/? Does selecting the text that appears buggy magically fix it?

Linking some threads:

@zadjii-msft commented on GitHub (Oct 31, 2022): Do you have anything in your powershell `$profile`/? Does selecting the text that appears buggy _magically fix it_? Linking some threads: * #11214 * #11334 * #12805 * #13840
Author
Owner

@vertigo220 commented on GitHub (Oct 31, 2022):

Profile command line:

%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -File "%userprofile%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile_Terminal_1.ps1"

Profile ps1 content:

function Prompt
{
  $host.ui.RawUI.WindowTitle = $(get-location)
  "PS $(get-location)> "
  $loc = $($executionContext.SessionState.Path.CurrentLocation);
  $out = "PS $loc$('>' * ($nestedPromptLevel + 1)) ";
  $out += "$([char]27)]9;9;`"$loc`"$([char]27)\"
  return $out
}

Selecting text does nothing. Of those linked issues, the only one that seems possibly related is the third one. I'm keeping the terminal open for now in case there's any debugging info I can pull from it or anything I can test, though obviously I can't leave it open indefinitely, so please let me know if there's anything you want me to test.

@vertigo220 commented on GitHub (Oct 31, 2022): Profile command line: `%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -File "%userprofile%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile_Terminal_1.ps1"` Profile ps1 content: ``` function Prompt { $host.ui.RawUI.WindowTitle = $(get-location) "PS $(get-location)> " $loc = $($executionContext.SessionState.Path.CurrentLocation); $out = "PS $loc$('>' * ($nestedPromptLevel + 1)) "; $out += "$([char]27)]9;9;`"$loc`"$([char]27)\" return $out } ``` Selecting text does nothing. Of those linked issues, the only one that seems possibly related is the third one. I'm keeping the terminal open for now in case there's any debugging info I can pull from it or anything I can test, though obviously I can't leave it open indefinitely, so please let me know if there's anything you want me to test.
Author
Owner

@zadjii-msft commented on GitHub (Nov 2, 2022):

Can you try again with powershell.exe -NoExit -NoProfile -File ...? There are... other... powershell profiles that can somethimes get loaded in, so I want to try and eliminate that as a possibility.

What version of PowerShell and PsReadline are you using? This is reminiscent of an old bug that was fixed on their side a few years ago.

@zadjii-msft commented on GitHub (Nov 2, 2022): Can you try again with `powershell.exe -NoExit -NoProfile -File ...`? There are... other... powershell profiles that can somethimes get loaded in, so I want to try and eliminate that as a possibility. What version of PowerShell and PsReadline are you using? This is reminiscent of an old bug that was fixed on their side a few years ago.
Author
Owner

@vertigo220 commented on GitHub (Nov 3, 2022):

I can try that, but the problem is the problem is intermittent so, between that and the fact that my use of Powershell is also intermittent, it could be a while before I'd see if that fixes it, and even if it doesn't happen again for a while, it would be impossible to know if that was because it's fixed or just chance.

PSVersion = 5.1.19041.1682
BuildVersion = 10.0.19041.1682

Don't know how to check the PSReadLine version

@vertigo220 commented on GitHub (Nov 3, 2022): I can try that, but the problem is the problem is intermittent so, between that and the fact that my use of Powershell is also intermittent, it could be a while before I'd see if that fixes it, and even if it doesn't happen again for a while, it would be impossible to know if that was because it's fixed or just chance. PSVersion = 5.1.19041.1682 BuildVersion = 10.0.19041.1682 Don't know how to check the PSReadLine version
Author
Owner

@ghost commented on GitHub (Nov 7, 2022):

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 7, 2022): 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

@vertigo220 commented on GitHub (Nov 7, 2022):

.

@vertigo220 commented on GitHub (Nov 7, 2022): .
Author
Owner

@zadjii-msft commented on GitHub (Nov 7, 2022):

Hey @vertigo220 I'm gonna give the bot another week to let you try out powershell.exe -NoExit -NoProfile -File .... If that doesn't repro this after a week, then I'd say we close this out. If this does come back after that, then we can always reopen. If it doesn't, then I'd reckon it's something in some powershell config somewhere. Probably something with [Console]::BufferSize

@zadjii-msft commented on GitHub (Nov 7, 2022): Hey @vertigo220 I'm gonna give the bot another week to let you try out `powershell.exe -NoExit -NoProfile -File ...`. If that doesn't repro this after a week, then I'd say we close this out. If this does come back after that, then we can always reopen. If it doesn't, then I'd reckon it's something in some powershell config somewhere. Probably something with `[Console]::BufferSize`
Author
Owner

@vertigo220 commented on GitHub (Nov 8, 2022):

Still need to check if I'm using an old PSReadLine version, but I don't know how to check it.

@vertigo220 commented on GitHub (Nov 8, 2022): Still need to check if I'm using an old PSReadLine version, but I don't know how to check it.
Author
Owner

@ghost commented on GitHub (Nov 12, 2022):

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 12, 2022): 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#18779