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

Resetting cursor style does not work #1377

Closed
erf opened this issue Dec 22, 2023 · 3 comments · Fixed by #1381
Closed

Resetting cursor style does not work #1377

erf opened this issue Dec 22, 2023 · 3 comments · Fixed by #1381
Labels
enhancement New feature or request feature-request User requested features VT: Backend Virtual Terminal Backend (libterminal API)

Comments

@erf
Copy link

erf commented Dec 22, 2023

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

@erf erf added the bug Something isn't working label Dec 22, 2023
@whisperity whisperity added the VT: Backend Virtual Terminal Backend (libterminal API) label Dec 22, 2023
@christianparpart christianparpart added enhancement New feature or request feature-request User requested features and removed bug Something isn't working labels Dec 22, 2023
@christianparpart
Copy link
Member

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
Copy link

j4james commented Dec 23, 2023

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
Copy link
Member

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. 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request User requested features VT: Backend Virtual Terminal Backend (libterminal API)
Projects
None yet
4 participants