microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.36k stars 28.61k forks source link

DECSCUSR 0 should reset to the user-defined cursorStyle #211394

Open notpeelz opened 4 months ago

notpeelz commented 4 months ago

VS Code Version: 1.88.1 OS: Linux

Steps to Reproduce:

  1. Add "terminal.integrated.cursorStyle": "line" to your settings.json
  2. Run these commands in the integrated terminal:
    printf "\033[4 q" # set cursor style to an underscore
    printf "\033[0 q" # this should restore the cursor to the user-defined preference
    printf "\033[ q"  # (this has the same effect as "0")
    # ...but instead we end up with a "block" cursor

Relevant code: https://github.com/xtermjs/xterm.js/blob/2edc65baaa50f8b99c67f3df6f8d5d93c70a69e6/src/common/InputHandler.ts#L2732-L2738

Many popular terminals implement this behavior (e.g kitty, alacritty, Windows Terminal, ...) More info on the topic: https://github.com/microsoft/terminal/pull/7379

xterm issue: https://github.com/xtermjs/xterm.js/issues/3293

kevinc16 commented 4 months ago

Hey folks, I'm new to the codebase and wanted to start contributing, I took a quick look at the issue and seems like the fix is on the xterm side, is it ok if I work on this issue?

kRaviteja7 commented 3 months ago

Hey folks, if the issue still open i would like to work this .

kmr-ankitt commented 3 months ago

Hey folks, I am new to opensource. Can i give it a try?

gagan-bhullar-tech commented 2 months ago

Hello, can i work on this.

Tyriar commented 2 months ago

If you'd like to work on this the fix will be in xterm.js: https://github.com/xtermjs/xterm.js/issues/3293

Arup-Chauhan commented 1 month ago

Hi @Tyriar is anyone working on issue, if no I could work on this!

Or maybe anything similar, I am new to this repo and would be nice to get started, thanks in advance!

Tyriar commented 1 month ago

@Arup-Chauhan doesn't look like anyone's working on it. There's some good insight into how to do it here https://github.com/xtermjs/xterm.js/issues/3293#issuecomment-2217365974

Arup-Chauhan commented 1 month ago

@Arup-Chauhan doesn't look like anyone's working on it. There's some good insight into how to do it here xtermjs/xterm.js#3293 (comment)

Great, so I will try and get started with it. Please assign me the issue.

Also, can I make a draft PR for doing this issue? will mark it ready for review once the work is done.

Tyriar commented 1 month ago

@Arup-Chauhan we don't normally assign issues to external people but it's here that you're planning on working on it. Yes a draft PR is fine if you want some early feedback

Arup-Chauhan commented 1 month ago

@Arup-Chauhan we don't normally assign issues to external people but it's here that you're planning on working on it. Yes a draft PR is fine if you want some early feedback

Okay, that's very understandable. Ill raise a draft PR.

I have a question already, asking there.

alekcunn commented 3 weeks ago

seems to work fine in native Ubuntu WSL. Just info for anyone working on it

Arup-Chauhan commented 3 weeks ago

seems to work fine in native Ubuntu WSL.

Hi @alekcunn, thanks for the info, great help!

Just info for anyone working on it

I have a fix that I proposed on the xterm.js repo I will start off by testing this on a Windows machine first.