microsoft / azserialconsole

Azure Serial Console
17 stars 10 forks source link

Copy and Paste Dropping Double Characters #85

Open paul-brown-cdw-az500 opened 4 years ago

paul-brown-cdw-az500 commented 4 years ago

I and noticed a number of issues reported with copy and paste generating additional characters, but I seem to have the opposite issue. I am using PowerShell inside a CMD channel and trying to set the ACLs on some files and running commands like:

$acl = Get-Acl -path $file.FullName -Audit $acl.SetAccessRule($rule)

but these are arriving in the console as:

$acl = Get-Acl -path $file.FullName -Audit $acl.SetAccesRule($rule)

Which is to say that some of the double characters are turning into single characters, but not all and not consistently; repeating the paste operation sometimes results in the correct characters and sometimes other doubles being affected. I am having to paste my scripts in to the console one line at a time so that I can delete the lines and paste them again when a character is missing.

I checked the installed modules and PSReadLine is not present, so this is not the cause of the issue.

asinn826 commented 4 years ago

Hey @paul-brown-cdw-az500 - thanks for the feedback. I'm finding this very difficult to reproduce in my Windows Server 2019 VM using PowerShell in SAC with PSReadLine removed. Did you see this issue with just the $acl.SetAccessRule($rule) string you mentioned, or did you run into any other strings that caused the issue?

paul-brown-cdw-az500 commented 4 years ago

@asinn826 It happened randomly with any pasted text with multiple characters and not consistently, so that pasting in text in the form of:

abc abc abbc abc abbc abcd abccd abcd abc

Would be reproduced in the console as

abc abc abc abc abbc abcd abcd abcd abc

with some of the doubles dropped and not others. Also, pasting the same text in a second time from the clipboard without re-copying would give a different result in that perhaps no doubles would be affected, perhaps the same ones and perhaps different ones. The results were not consistent at all.

asinn826 commented 4 years ago

I see, thanks for the detail @paul-brown-cdw-az500. I'm able to somewhat reproduce when pasting 2 lines into PowerShell - this is what I get:

Input: abc abc abbc abc abbc abcd abccd abcd abc

PowerShell output: image

So the "abccd" in the second line got turned into "abcd". I see the same in CMD as well as PowerShell. I don't think this is a serial console-specific issue as I don't see this in a Linux VM. I've reached out to the SAC folks on the Windows team internally to see if they might know anything about this - at the very least it will put this issue on their radar.

asinn826 commented 4 years ago

Hi @paul-brown-cdw-az500 - following up on this after a bunch of internal discussions. It looked to be that the terminal emulator (xtermjs for us) was "typing" faster than Windows SAC could process, which mean that some text got dropped as it tried to make its way from your local clipboard through the serial connection through SAC on the Windows VM.

The SAC team made some investments in the SAC experience a few months back which seems to have addressed the paste issue, so this shouldn't be an issue in newer Windows Server builds. The Windows Semi-Annual Channel (SAC, yes, the acronym is overloaded) images on Azure should have the new SAC (Special Administration Console), but there will be some lead time for this change to be available on the LTSC Windows images on Azure.

XVII commented 1 year ago

Is there a mitigation, such as a delay, the Serial Console team can put in to help space out the requests before they hit the console? This affects a bunch of older Windows Server machines.

i.e. xtermjs could delay each keystroke when pasting large amounts of text.