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

PSReadLine's -ViModeIndicator "Cursor" doesn't work correctly #13235

Closed
nlguerra2003 opened this issue Jun 6, 2022 · 6 comments
Closed

PSReadLine's -ViModeIndicator "Cursor" doesn't work correctly #13235

nlguerra2003 opened this issue Jun 6, 2022 · 6 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Resolution-External For issues that are outside this codebase

Comments

@nlguerra2003
Copy link

Windows Terminal version

1.12.10983.0

Windows build number

10.0.22621.0

Other Software

PSReadLine

Steps to reproduce

  • Activate PSReadLine's Vi mode: Set-PSReadLineOption -EditMode Vi
  • Activate "Cursor" as mode indicator: Set-PSReadLineOption -ViModeIndicator Cursor
  • Since you start in INSERT mode, just type Esc to change to NORMAL.

Expected Behavior

Cursor should, as it happens in "pure" powershell, be a box in NORMAL mode, and the default one in INSERT (it doesn't matter what cursor you set up in WT).

Actual Behavior

Cursor won't change no matter what mode you select. It will always be the configured cursor.

@nlguerra2003 nlguerra2003 added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jun 6, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jun 6, 2022
@zadjii-msft
Copy link
Member

Which version of PowerShell and PSReadline are you using/?

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 6, 2022
@nlguerra2003
Copy link
Author

PS Version: 7.2.4
PSReadLine Version: 2.2.5

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jun 6, 2022
@juliekoubova
Copy link

Happy holidays, folks! Any update on this?

@j4james
Copy link
Collaborator

j4james commented Dec 26, 2022

The problem was that PSReadLine was originally using the .NET Console.CursorSize API to change the cursor size, and that relies on the Win32 SetConsoleCursorInfo API, which isn't supported in Windows Terminal (that's more or less tracked in issue #7382).

The good news is that PSReadLine recently merged a PR (PowerShell/PSReadLine#3374) which updates the ViModeIndicator implementation to use escape sequences to change the cursor shape (switching between a block cursor and underscore cursor), and that should work in Windows Terminal.

Unfortunately it doesn't look like that fix has been released yet, but I'm guessing it will likely be included in the next PSReadLine release.

@zadjii-msft
Copy link
Member

Sorry, must've lost this in the backlog.

Yep, I'd reckon this is fixed by the aforementioned upstream PsReadline issue.

/dup PowerShell/PSReadLine#3334

@zadjii-msft zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
@ghost
Copy link

ghost commented Jan 3, 2023

Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!

@ghost ghost closed this as completed Jan 3, 2023
@ghost ghost added Resolution-External For issues that are outside this codebase and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jan 3, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

4 participants