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

dynamic cursorShape for shell vi mode #4734

Closed
mpgarate opened this issue Feb 27, 2020 · 4 comments
Closed

dynamic cursorShape for shell vi mode #4734

mpgarate opened this issue Feb 27, 2020 · 4 comments
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-Answered Related to questions that have been answered

Comments

@mpgarate
Copy link

Hello Terminal team 👋

Description of the new feature/enhancement

When normal mode is active in vim or shell vi mode, the cursor stays in the same style ("bar"). On mac and linux terminals the cursor would typically change to something like the "emptyBox" shape for normal mode and "bar" for insert mode.

To reproduce this behavior, we can use Windows Terminal to run cygwin or access a linux machine via ssh and run the following:

set -o vi

Then, pressing escape will enter normal mode where we might expect to see a box highlighting the current letter. Instead we still see the "bar" style, moved one character back. The "box" appearance is helpful to see which character is selected and as a visual aid to know when insert or normal mode is active.

I found a few workarounds for vim using vimrc (i.e. in issue #68) but have not yet seen a suggestion for shell vi mode.

@mpgarate mpgarate added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Feb 27, 2020
@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 Feb 27, 2020
@zadjii-msft
Copy link
Member

Maybe some combo of #4106, #1604 - I could have sworn there was a more specific dupe...

@jdebp
Copy link

jdebp commented Feb 27, 2020

Windows Terminal already supports the DECSCUSR control sequence with parameters from 1 to 8. There's nothing else that Windows Terminal has to do, here, pace the bug about it not taking effect until flushed. The rest is all at the host end.

The rest is a matter of having the Ss and Se capabilities in your terminfo database records, and a shell that understands those (relatively new, as they were invented in 2011) terminal capabilities. It is almost certainly terminal type and terminfo that is your problem here.

@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented Feb 27, 2020

Indeed! Thanks @jdebp.

In addition, somebody's put together a solution for versions of readline that do not take Ss and Se into account: https://stackoverflow.com./a/48449104

@DHowett-MSFT DHowett-MSFT added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 27, 2020
@mpgarate
Copy link
Author

Thank you for the responses. In my case, cygwin with bash 4.4.12 did not work with show-mode-in-prompt, and (as expected) this did not work in an older linux bash 4.2.46 I had available for testing. It will take some more investigation on my part to troubleshoot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

4 participants