Skip to content
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

Running gsutil command breaks -EditMode Emacs for the rest of the session. #1970

Closed
lukeschlather opened this issue Nov 19, 2020 · 13 comments
Closed
Assignees
Labels
Resolution-Not Repro The issue cannot be reproduced.

Comments

@lukeschlather
Copy link

Environment

PS version: 6.2.1
PSReadline version: 2.1.0
os: 10.0.19041.1 (WinBuild.160101.0800)
PS file version: 6.2.1.0
HostName: ConsoleHost
BufferWidth: 172
BufferHeight: 9001

Steps to reproduce

I am using Set-PSReadLineOption -EditMode Emacs. When I run a gsutil command, for example gsutil ls, Emacs mode is at least partially broken.

Specifically, "ctrl+a" reverts to being select-all rather than "go to beginning of line." I don't think auth is required to trigger the issue, I get it just after doing this:

> gsutil ls
You are attempting to perform an operation that requires a project id, with none configured. Please re-run gsutil config and make sure to follow the instructions for finding and entering your default project id.

ctrl+a is broken until I close the powershell window. I assume gsutil is sending some sort of control character? I'm not sure what the simplest way to do a binary analysis of what it's outputting is.

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Nov 19, 2020
@StevenBucher98
Copy link
Collaborator

Hi @lukeschlather are you still facing this problem in the latest versions of PSReadLine and gsutil?

@StevenBucher98 StevenBucher98 added Needs-Author Feedback and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Mar 6, 2023
@ghost
Copy link

ghost commented Mar 14, 2023

This issue is closed because it has been marked as requiring author feedback but has not had any activity for 7 days. If you think the issue is still relevant, please reopen and provide your feedback.

@ghost ghost closed this as completed Mar 14, 2023
@lukeschlather
Copy link
Author

It's still happening with PSReadline 2.2.6 and gsutil 5.21. In fact just running gsutil version triggers the issue.

@daxian-dbw daxian-dbw reopened this Mar 14, 2023
@daxian-dbw daxian-dbw added Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. and removed Needs-Author Feedback labels Mar 14, 2023
@StevenBucher98
Copy link
Collaborator

@lukeschlather are you running the latest version of PowerShell (7.3)?

@StevenBucher98 StevenBucher98 self-assigned this Apr 17, 2023
@lukeschlather
Copy link
Author

Yes.

@StevenBucher98
Copy link
Collaborator

StevenBucher98 commented May 8, 2023

Hmm alt+a seem to work correctly for me given your repro steps in the latest beta release of PSReadLine (2.3.1-beta1). Give that a try. Let me know if you are still coming across this issue and we can dig in further

@StevenBucher98 StevenBucher98 added Needs-Author Feedback and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels May 8, 2023
@lukeschlather
Copy link
Author

> Get-Module PSReadLine

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.3.1      beta1      PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption…

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.4
PSEdition                      Core
GitCommitId                    7.3.4
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

I should say this is all the relevant stuff in my profile:

if ($host.Name -eq 'ConsoleHost')
{
    Import-Module PSReadLine
    Set-PSReadLineOption -EditMode Emacs
    Set-PSReadLineKeyHandler -Key 'Ctrl+V' -Function Paste
    Set-PSReadLineKeyHandler -Key 'Ctrl+v' -Function Paste
    Set-PSReadLineKeyHandler -Key 'Ctrl+/' -Function Undo
    Set-PSReadLineKeyHandler -Key 'Ctrl+Backspace' -Function BackwardKillWord
    Set-PSReadLineKeyHandler -Key 'Ctrl+LeftArrow' -Function BackwardWord
    Set-PSReadLineKeyHandler -Key 'Ctrl+RightArrow' -Function ForwardWord
    Set-PSReadLineOption -AddToHistoryHandler $null
    Set-PSReadlineOption -BellStyle None 
}

@lukeschlather
Copy link
Author

@daxian-dbw
Copy link
Member

@lukeschlather I cannot reproduce the issue on Windows. From my screen GIF below, you can see that I press Ctrl+a, and the cursor goes to beginning of line as expected.

repro

I'm using 2.3.1-beta1 version of PSReadLine with PSv7.2.11 on Windows 11. gsutil version returns 5.23. I started a fresh pwsh session without profile, and then ran the relevant command in your previous comment to mimic your session.

Can you please provide detailed repro steps to help us reproduce the issue locally?

@daxian-dbw daxian-dbw added Needs-Author Feedback Needs-Repro There is no sufficient information on repro steps. and removed Needs-Attention 👋 labels May 9, 2023
@lukeschlather
Copy link
Author

I can reproduce this on two different Windows laptops running Windows 10 Pro. I ran pwsh -noprofile from a cmd prompt and followed your steps and I can repro the issue.

I launched a Windows Server 2022 datacenter edition image in Google Cloud:
https://console.cloud.google.com/compute/imagesDetail/projects/windows-cloud/global/images/windows-server-2022-dc-v20230414

launched powershell

Install-Module -Name PSReadline -Force -RequiredVersion 2.3.1-beta1 -AllowPrerelease

launched a cmd / pwsh -noprofile, did

    Import-Module PSReadLine
    Set-PSReadLineOption -EditMode Emacs

ctrl-a works normally.
Run gsutil with no args, ctrl-a does select all.

@ghost ghost added Needs-Attention 👋 and removed Needs-Author Feedback Needs-Repro There is no sufficient information on repro steps. labels May 10, 2023
@daxian-dbw
Copy link
Member

daxian-dbw commented May 10, 2023

I created fresh Azure VMs for Windows 10 Pro (Version 22H2, OS Build 10.0.19045.2965) and Windows Server 2022 (Version 21H2, OS Build 10.0.20348.1726), and used the exact steps as described in your last comment, but I still cannot reproduce the issue.

Below are the GIFs showing my steps on both VMs. Ctrl+a works as expected -- cursor goes to the beginning of line -- after running gsutil:

Windows 10 Pro

repro-win10

Windows Server 2022

repro-ws-2022


I suspect this is very specific to the system environment you are using, maybe another software playing a role in combination with gsutil that together causes the console/terminal to work differently. Anyway, I really cannot reproduce the reported issue.

@daxian-dbw daxian-dbw added Resolution-Not Repro The issue cannot be reproduced. and removed Needs-Attention 👋 labels May 10, 2023
@lukeschlather
Copy link
Author

I can't repro on an Azure VM with the same specs as you either ( Windows 10 Pro / 22H2 / OS Build 19045.2965 )

However my local laptop with the same OS version reproduces the issue, as does a stock GCP VM running the Google image, which has Windows Server 2022 Datacenter / 21H2 / OS Build 20348.1668 .

I compared Google SDK versions and my laptop still reproduces the issue after being updated to the latest version of the gcloud sdk ( 430.0.0 ). I compared the components installed with gcloud components list and I don't see any differences there either.

@ghost ghost closed this as completed May 11, 2023
@daxian-dbw
Copy link
Member

However my local laptop with the same OS version reproduces the issue, as does a stock GCP VM running the Google image, which has Windows Server 2022 Datacenter / 21H2 / OS Build 20348.1668 .

That's why I was suspecting maybe something else is playing a role in combination with gsutil for the terminal/console to behave differently. And I cannot reproduce it on my local Windows 11 machine as well (#1970 (comment)).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Not Repro The issue cannot be reproduced.
Projects
None yet
Development

No branches or pull requests

3 participants