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

[Terminal] Cursor shape escape sequences not working #601

Closed
caksoylar opened this issue May 8, 2019 · 4 comments · Fixed by #941
Closed

[Terminal] Cursor shape escape sequences not working #601

caksoylar opened this issue May 8, 2019 · 4 comments · Fixed by #941
Labels
Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@caksoylar
Copy link

caksoylar commented May 8, 2019

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.18362.86]

  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)
    Using DECSCUSR escape sequences do not change the cursor shape, which is fixed to what it is set in profiles.json.

  • What's wrong / what should be happening instead:
    Cursor shape changes like it does in conhost, see conhost above and Terminal below:
    decscusr

AFAICT all sequences here are supported in conhost, and larger values (e.g. echo -e -n "\x1b[\x37 q") changes it to the "legacy underscore" version. Also related #68.

@zadjii-msft zadjii-msft added Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. labels May 8, 2019
@zadjii-msft zadjii-msft added this to the Windows Terminal v1.0 milestone May 8, 2019
@zadjii-msft
Copy link
Member

Yep that's correct, the cursor sequences aren't hooked up quite yet for the terminal.

If someone wants to take their chances at implementing this themselves, I'd take a look at Terminal.h/cpp, TerminalApi.cpp, TerminalDispatch.cpp.

I believe these two are the methods that need to be Implemented in TerminalDispatch:

    // From TermDispatch.hpp
    virtual bool SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle) = 0; // DECSCUSR
    virtual bool SetCursorColor(const COLORREF Color) = 0; // OSCSetCursorColor, OSCResetCursorColor

@zadjii-msft zadjii-msft added the Help Wanted We encourage anyone to jump in on these. label May 8, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Product-Terminal The new Windows Terminal. and removed Mass-Chaos labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@anirudhrb
Copy link
Contributor

anirudhrb commented May 22, 2019

Hi! Is anybody working on this? I would like to take a stab at it!

@zadjii-msft zadjii-msft removed the Help Wanted We encourage anyone to jump in on these. label May 22, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 23, 2019
@miniksa miniksa added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label May 29, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 29, 2019
@simlei
Copy link

simlei commented Oct 7, 2019

In my version -- latest released to date, and with Powershell Core -- the cursor still does not change shape in vim on WSL.

@aaronbieber
Copy link

I deleted a previous comment asserting that this is not fixed, which was incorrect.

However, it is true that neither Vim nor Emacs seem to be able to detect (or detect reliably and/or accurately) the capabilities of the terminal to enable the cursor behavior that one would expect after using the GUI versions of those programs.

I'm leaving this note for anyone who stumbles on this thread, as I did. You will likely need to amend your Vim or Emacs configuration to make cursor shape change as you expect.

If you use Emacs, you may try the evil-terminal-cursor-changer package (available in Melpa), though note that as of this time, that package will not correctly identify Windows Terminal as an xterm-compatible terminal, so you should set the XTERM_VERSION environment variable to any value (I did that from within my Emacs config), to force it to use the xterm escape sequences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants