CloudShell icon indicating copy to clipboard operation
CloudShell copied to clipboard

[BUG] Powershell corrupt history

Open darrentu opened this issue 2 years ago • 2 comments

To Reproduce

cat (Get-PSReadLineOption).HistorySavePath

You should be able to see the Powershell history that has been saved throughout all the sessions (of that clouddrive instance). Note that this history is saved in the user's own clouddrive.

Observed Behavior

ls
cd ..
clear
ls
ls��#@@���@@@@@@@@@@@@@@@@@@h3�@@@@@@@@@@hello_profile.ps1n@m@l@m@p@s@@@@�@@@@@@@@@@@@!��=@@@@@@@@@@@@@@+C@@@@@@@@@@@@z�
ls��#@@���@@@@@@@@@@@@@@@@@@h3�@@@@@@@@@@hello_profile.ps1n@m@l@m@p@s@@@@�@@@@@@@@@@@@!��=@@@@@@@@@@@@@@+C@@@@@@@@@@@@zd@@rR�@@P.x�%E�U@@�^�@@@����@@�^��@@@@P.x�%E�U@@�^�@@@����@@�^��@@@@���#@@��z�%E�U@@�^�@@@����@@�^��@@@@@@@@@@@@@��@@�
��%E�U@@�^�@@@����@@�^��@@@@x@�@@@@@@@@@@@@@@@@@@��%E�U@@�^�@@@����@@�^��@@@@@@@@@@@@@@@@���@@@
env
clear

We see some weird characters in some of the history

Expected behavior

All the history should be clear and visible for the user to see.

Is this specific to Cloud Shell?

Yes

Interface information

Portal.azure.com and using Microsoft Edge

Additional context

Add any other context about the problem here.

AB#14440014

darrentu avatar Apr 27 '22 16:04 darrentu

We're moving this back to the backlog due to higher priorities. Please upvote this issue if you need it fixed sooner.

dsajanice avatar Jun 30 '22 17:06 dsajanice

Thank you for reporting this.  This has been identified as an issue in PowerShell on linux. I've created an issue for the Powershell team here:  https://github.com/PowerShell/PowerShell/issues/19396.

At this time, the problem is reproducible and needs to be investigated before a solution can be determined.   A possible workaround for the customer is to copy the entire contents of the file to a single string in the clipboard.    Example using the repro_text.txt attached to the issue filed with PowerShell.

Get-Content .\repro_text.txt | set-clipboard

Then text can then be pasted into PowerShell ( locally or in Azure Cloud Shell).

theJasonHelmick avatar Mar 22 '23 22:03 theJasonHelmick