contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.4k stars 103 forks source link

Resetting cursor style does not work #1377

Closed erf closed 9 months ago

erf commented 9 months ago

Contour Terminal version

0.4.0.6245

Installer source

Github: source code cloned

Operating System

MacOS 14.2.1 (23C71)

Architecture

ARM64

Other Software

No response

Steps to reproduce

printf "\033[1 q"
printf "\033[ q"

Expected Behavior

should reset cursor style back to line mode, which is the original cursor style when opening contour

Actual Behavior

nothing happens , cursor stay in block mode

Additional notes

btw on ghostty cursor style changes when in vim normal and insert mode, in contour it always stay in line mode

christianparpart commented 9 months ago

Hi, what brings you to the conclusion that printf "\033[ q" should reset it back to what it was?

To be honest, I do indeed like that idea, but it's not what the ctlseqs.txt documentation is saying at least.

It states:

CSI Ps SP q
          Set cursor style (DECSCUSR), VT520.
            Ps = 0  -> blinking block.
            Ps = 1  -> blinking block (default).
            Ps = 2  -> steady block.
            Ps = 3  -> blinking underline.
            Ps = 4  -> steady underline.
            Ps = 5  -> blinking bar, xterm.
            Ps = 6  -> steady bar, xterm.

So leaving this numeric parameter out is equivalent to say 1. I still like this idea, so, is there any other terminal except Ghostty doing this or app already using that behaviour?

j4james commented 9 months ago

It's an extension that was proposed by VTE (I think) several years ago, and quite a few other terminals have adopted it. Just looking at my notes from a few years back, the ones I believe supported it were VTE, WezTerm, Alacritty, Konsole, Kitty, Mintty, and Windows Terminal.

Not all of them worked the same way, though. If you're following the VTE behaviour, both an omitted parameter and 0 should be interpreted as the user-preferred style. But some terminals only worked with a 0 parameter explicitly.

christianparpart commented 9 months ago

oh really. wow. Many thanks @j4james. Too bad ctlseqs.txt does not reflect that :-(

I'll go ahead than. Thank you a lot. :)

If you're following the VTE behaviour, both an omitted parameter and 0 should be interpreted as the user-preferred style

That is what we will be doing then. 🥳