Rendering - PSReadline's MenuComplete output was rendered twice #4765

Closed
opened 2026-01-30 23:56:01 +00:00 by claunia · 6 comments
Owner

Originally created by @xa0082249956 on GitHub (Nov 1, 2019).

Environment

Name Value
Platform Win32NT
ServicePack
Version 10.0.19013.0
VersionString Microsoft Windows NT 10.0.19013.0
Windows Terminal version 0.6.2951.0 from Microsoft Store

TL;DR GIF

fig.gif

Steps to reproduce

  1. Open a PowerShell tab in Windows Terminal.
  2. Type Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
  3. cd to a folder with lots of files.
  4. Type ls and then enter.
  5. After it finished, type Start- and press Tab to trigger MenuComplete

Expected behavior

A auto completion menu is displayed once and I can select with my keyboard.

Actual behavior

I can select but auto completion menu is displayed twice.

Originally created by @xa0082249956 on GitHub (Nov 1, 2019). # Environment |Name|Value| |-------------|--------| |Platform | Win32NT| |ServicePack || |Version |10.0.19013.0| |VersionString | Microsoft Windows NT 10.0.19013.0| |Windows Terminal version | 0.6.2951.0 from Microsoft Store| # TL;DR GIF ![fig.gif](https://i.loli.net/2019/11/01/6bWMlK54karNFGy.gif) # Steps to reproduce 1. Open a PowerShell tab in Windows Terminal. 2. Type `Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete` 2. `cd` to a folder with lots of files. 3. Type `ls` and then enter. 4. After it finished, type `Start-` and **press `Tab` to trigger `MenuComplete`** # Expected behavior A auto completion menu is displayed **once** and I can select with my keyboard. # Actual behavior I can select but auto completion menu is displayed **twice**.
claunia added the Issue-BugArea-VTResolution-ExternalProduct-ConptyPriority-2 labels 2026-01-30 23:56:01 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Nov 1, 2019):

@xa0082249956 What psreadline version are you using?

@zadjii-msft commented on GitHub (Nov 1, 2019): @xa0082249956 What psreadline version are you using?
Author
Owner

@xa0082249956 commented on GitHub (Nov 1, 2019):

@xa0082249956 What psreadline version are you using?

Version 2.0.0.

~\Documents\PowerShell> Get-Module PSReadLine | Format-List

Name              : PSReadLine
Path              : C:\Users\xtyzw\Documents\PowerShell\Modules\PSReadLine\2.0.0\PSReadLine.psm1
Description       : Great command line editing in the PowerShell console host
ModuleType        : Script
Version           : 2.0.0
PreRelease        : beta4
NestedModules     : {Microsoft.PowerShell.PSReadLine2}
ExportedFunctions : PSConsoleHostReadLine
ExportedCmdlets   : {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler}
ExportedVariables :
ExportedAliases   :
@xa0082249956 commented on GitHub (Nov 1, 2019): > @xa0082249956 What psreadline version are you using? Version **2.0.0**. ```powershell ~\Documents\PowerShell> Get-Module PSReadLine | Format-List Name : PSReadLine Path : C:\Users\xtyzw\Documents\PowerShell\Modules\PSReadLine\2.0.0\PSReadLine.psm1 Description : Great command line editing in the PowerShell console host ModuleType : Script Version : 2.0.0 PreRelease : beta4 NestedModules : {Microsoft.PowerShell.PSReadLine2} ExportedFunctions : PSConsoleHostReadLine ExportedCmdlets : {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…} ExportedVariables : ExportedAliases : ```
Author
Owner

@DHowett-MSFT commented on GitHub (Nov 4, 2019):

This looks like an issue with PSReadline, honestly. It doesn't repro under the same circumstances with the PSReadline 2.0.0 beta2/3 that's shipped with Windows.

@DHowett-MSFT commented on GitHub (Nov 4, 2019): This looks like an issue with [PSReadline](https://github.com/PowerShell/PSReadline), honestly. It doesn't repro under the same circumstances with the PSReadline 2.0.0 beta2/3 that's shipped with Windows.
Author
Owner

@DHowett-MSFT commented on GitHub (Nov 4, 2019):

We could still handle it better, though.

@DHowett-MSFT commented on GitHub (Nov 4, 2019): We could still handle it better, though.
Author
Owner

@xa0082249956 commented on GitHub (Nov 5, 2019):

This looks like an issue with PSReadline

You are right. I update PSReadLine to version 2.0.0-beta5 and now I can't repro the issue anymore.
I checked the update log of PSReadLine and found the problem is fixed in a PR.

However, I still cannot understand why I can only found the problem in Windows Terminal. Maybe just because the problem happens randomly.

@xa0082249956 commented on GitHub (Nov 5, 2019): > This looks like an issue with [PSReadline](https://github.com/PowerShell/PSReadline) You are right. I update `PSReadLine` to version `2.0.0-beta5` and now I can't repro the issue anymore. I checked the update log of `PSReadLine` and found the problem is fixed in a [PR](https://github.com/PowerShell/PSReadLine/pull/937). However, I still cannot understand why I can only found the problem in Windows Terminal. Maybe just because the problem happens randomly.
Author
Owner

@zadjii-msft commented on GitHub (Mar 16, 2020):

Hey since this is fixed upstream, I'm going to close this one out.

I bet the reason that this seemed more prevalent in the Windows Terminal is because we're using conpty. When things are running in conpty, they're always running in a virtual console buffer that's only ever the size of the viewport, so the console is always at the end of the buffer.

@zadjii-msft commented on GitHub (Mar 16, 2020): Hey since this is fixed upstream, I'm going to close this one out. I bet the reason that this seemed more prevalent in the Windows Terminal is because we're using conpty. When things are running in conpty, they're always running in a virtual console buffer that's only ever the size of the viewport, so the console is _always_ at the end of the buffer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4765