Closed ericohlin closed 4 years ago
Doesn't repro for me with 2.0.0-beta4
@SteveL-MSFT - This was reported against 1.2 and sounds familiar, so I'm guessing it was fixed.
Still an issue
I cannot reproduce this, so there must be something more that might be needed. A confirmation of the placement of the cursor with a snapshot could be helpful. Also, are you on the same version of Windows? I am testing in Windows 10 1903 build 18362.145.
Also, what did you expect to happen? What item was supposed to come up for completion? At the position, I would expect no completion, and that is what I get.
I can reproduce this issue on Windows Server 2016, Powershell Version = 5.1.14393.3053
However, I cannot reproduce this error on Windows Server 2019, Powershell Version = 5.1.17763.592
I'm not sure if pursuing this is worth it since it appears to be fixed in newer issues. Just in case though, to reproduce place the cursor on this space and hit Tab.
I would expect nothing to happen, yet it errors and directs users to report the issue.
There are other ways to replicate this error, attempting to tab at certain locations, this is just one example.
Thanks! Eric O
The issue is probably dependent on the version of PowerShell, or the version of the AD module, and if a newer version of PSReadLine still produces the error, there is probably something to fix, even though it may be bad results coming from PowerShell's completer logic.
What happens if you press CTRL-SPACE at that point? You will probably still get the error, but just before that, it should build a menu with the possible completions, unless only 1 possible completion is being returned.
I tried this on 5.1.14409.1018 and could not reproduce it. I have some more machines to try, they'll probably be the same version, though.
Hey @msftrncs ,
I'm verifying you read my comment above correctly. However, I cannot reproduce this error on Windows Server 2019, Powershell Version = 5.1.17763.592 . There is definitely some variance in results between PSVersions.
Pressing CTRL-SPACE produces the same error.
We might be able to rule out the AD Module as I can replicate the issue using another cmdlet.
Get-ChildItem C:\ConfigMgrAdminUISetup.log | Format-Table -Property @{Name="Test";Expression={$_.FullName};}
Format-Table lives in Microsoft.PowerShell.Utility and this version remains the same between my Windows Server 2016 and 2019 test. Version = 3.1.0.0
Thanks!
I am thinking its looking at possibly completions for hashtable elements, and it may have returned a null result (not an empty result set), because there is no real completions for hashtable properties during a hashtable declaration, that was probably fixed between build 14393 and 14409.
Reviewing the code in the call stack, I am pretty sure that the older version of PowerShell is incorrectly returning an invalid result set, which then causes PSReadLine to deliberately throw an exception in 'Replace'. The value passed as 'Start' I believe comes from PowerShell, so nothing PSReadLine can do about it.
PSReadLine does need to gracefully handle buggy completion results.
This sounds like something I fixed, maybe in 2.0.0-beta1 or beta2.
For those repro'ing this, please confirm you are using latest beta of PSReadLine 2.0.0 as a number of these issues have been fixed
@lzybkr, looks like you are referring to #534.
It looks to me this issue has been fixed in PSReadLine 2.0.0, so I will close it for now. Please try out the 2.0.0-rc1 from the PowerShell Gallery.
Environment data
PS version: 5.1.14393.2828 PSReadline version: 1.2 os: 10.0.14393.0 (rs1_release.160715-1616) PS file version: 10.0.14393.0 (rs1_release.160715-1616)
Thank you! :)
Steps to reproduce or exception report
PS C:\Temp> Get-ADUser eohlin -Properties * | Format-Table -Property @{Name="MemberOf";Expression={$_.memberof};} Oops, something went wrong. Please report this bug with the details below. Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
Last 200 Keys: LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow UpArrow LeftArrow L eftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow R ightArrow RightArrow RightArrow RightArrow RightArrow RightArrow End LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow LeftArrow LeftArrow L eftArrow LeftArrow Ctrl+LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Ctrl+LeftArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow Righ tArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow Ctrl+RightArrow RightArrow RightArrow Ctrl+RightArrow RightArrow RightArrow Ctrl+RightArrow RightArrow RightArrow Ctrl+RightArrow RightArrow RightArrow Ctrl+RightArrow RightArrow Ctrl+RightArrow RightArrow RightArrow RightArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Ctrl +LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow Ctrl+LeftArrow LeftArrow LeftArrow LeftArrow RightArrow LeftArrow LeftArro w LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Backspace Backspace Backspace Backspace t a Tab Enter UpArrow LeftArrow LeftArrow RightArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Tab ; Tab
Exception: