Skip to content

Read-Host paste dropping letters after F8/F5 #2741

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

Closed
ili101 opened this issue Jun 3, 2020 · 13 comments
Closed

Read-Host paste dropping letters after F8/F5 #2741

ili101 opened this issue Jun 3, 2020 · 13 comments

Comments

@ili101
Copy link

ili101 commented Jun 3, 2020

Issue Type: Bug

This is similar to fixed bug #2291
On the original issue it was happening every time Read-Host was used.

Apparently now it happens only if you F8 or F5 (Run anything doesn't matter) then F8 or F5 again this time with Read-Host and paste something.
Random characters from the string pasted will be missed.
If you Enter/Ctrl+C between the 2 actions this doesn't happen.

Read

Extension version: 2020.6.0
VS Code version: Code 1.45.1 (5763d909d5f12fe19f215cbfdd29a91c0fa9208a, 2020-05-14T08:27:35.169Z)
OS version: Windows_NT x64 10.0.17763

1591194302-8adf92aa-6105-406f-97ea-3c9013c8ba161591191688507.zip

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (2 x 3392)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: disabled_off
oop_rasterization: unavailable_off
protected_video_decode: unavailable_off
rasterization: unavailable_off
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 2.00GB (0.43GB free)
Process Argv
Screen Reader no
VM 100%
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jun 3, 2020
@SydneyhSmith SydneyhSmith added Area-Extension Terminal Area-PSReadLine Issue-Bug A bug to squash. and removed Needs: Triage Maintainer attention needed! labels Jun 4, 2020
@jpalo
Copy link

jpalo commented Jun 9, 2020

I'm also struggling with same issue, I believe it is related: pasting text to integrated PS console keeps dropping/replacing characters. I copy credentials from password app, and use right mouse click to paste.

In the image at the left you see GUID pasted to PS integrated console and the beginning is strangely messed up, haven't figured out any logic what it is doing there. Next I pasted it into Notepad and that is correct.

If I paste to PS integrated console, then backspace to remove the incorrect string, and paste again, it pastes correctly. There isn't a constant repro, as usually it works. I haven't been able to figure out what triggers this, but I feel it is happening more often on fresh consoles. Killing console and opening a new one doesn't guarantee a repro, though.

When the issue occurs, I also see the missing characters outputted at the end on the blank command line, as in OP video.

image

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jun 9, 2020
@ili101
Copy link
Author

ili101 commented Jun 9, 2020

@jpalo Yes looks like the same thing. 100% reproducible for me also with Get-Credential

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Jun 9, 2020
@ili101
Copy link
Author

ili101 commented Mar 20, 2022

Bug regression - this was fixed in stable in 2020-2021 but is happening again in PowerShell Preview (tested on v2022.3.0)

@andyleejordan
Copy link
Member

@ili101 Can you test the build I just posted in #3876 (comment)? I'm not sure if this is the fix for this issue, but would like to see...

@andyleejordan
Copy link
Member

I don't think that build is going to fix your issue, it seems separate. Like, I just repro'd it. Very strange.

@andyleejordan
Copy link
Member

How big an issue is this for you @ili101, is it blocking any scenarios or can you just call Read-Host interactively and paste that way?

@andyleejordan andyleejordan moved this from Todo to In Progress in Sea Biscuit Mar 22, 2022
@ili101
Copy link
Author

ili101 commented Mar 22, 2022

@andschwa Did some more testing (with the build you mentioned).
No problem when using terminal directly without F8/F5.
With F8/F5 when typing it will miss the first letter.
With F8/F5 when pasting unpredictable.

I think it's maybe related to #3881

@andyleejordan
Copy link
Member

Feels like a repeat of #2291

@ili101
Copy link
Author

ili101 commented Mar 31, 2022

Rewrite part 2 coming up? 🤔😁
Just an uninformed idea, will it be easier or harder to use the VSCode input thingy instead of the terminal for input?
image

@andyleejordan
Copy link
Member

andyleejordan commented Mar 31, 2022

...that's a brilliant idea. We'd need to rewire Read-Host to send a message over LSP to ask for input, and then handle that in the client...but doable. @SeeminglyScience add this to the list of ideas! I think it'd make for a really nice UX.

@andyleejordan
Copy link
Member

Hi there, we just released v2022.4.0-preview! Could you please try PowerShell Preview for VS Code and verify this is fixed? It seemed to be in my testing, so marking as resolved, but please let me know if it's still occurs (or if new bugs show up)!

@andyleejordan andyleejordan added the Resolution-Fixed Will close automatically. label Apr 12, 2022
@andyleejordan
Copy link
Member

Rewrite part 2 coming up?

It happened!!!

@ghost ghost closed this as completed Apr 13, 2022
@ghost
Copy link

ghost commented Apr 13, 2022

This issue has been marked as fixed. It has been automatically closed for housekeeping purposes.

Repository owner moved this from In Progress to Done in Sea Biscuit Apr 13, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants