Use DECSCUSR 0 to reset to default
ClosedPublic

Authored by sandsmark on Nov 30 2018, 4:56 PM.

Details

Summary

This isn't standardized, but matches what VTE does.

printf '\e[0 q' # reset to default

Ref. https://bugzilla.gnome.org/show_bug.cgi?id=720821 and
https://bug720821.bugzilla-attachments.gnome.org/attachment.cgi?id=291238

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sandsmark created this revision.Nov 30 2018, 4:56 PM
Restricted Application added a project: Konsole. · View Herald TranscriptNov 30 2018, 4:56 PM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
sandsmark requested review of this revision.Nov 30 2018, 4:56 PM

Hello.

IIRC, I researched that issue when I submitted the DECSCUSR diff; and the current behaviour matches the VT510[1], VT520[2] documentation and the XTerm implementation.

And I went with the logic that matching the VT docs and XTerm behaviour is a safer way of implementing this, as the main consumers of such features are terminal apps like vim, which, AFAICS, tend to implement those features based on XTerm (as the de-facto terminal emulator out there).

So, in my mind anyway, this makes things easier for those apps, as they wouldn't have to add special workarounds/quirks for Konsole.

[1] https://www.vt100.net/docs/vt510-rm/DECSCUSR.html
[2] https://www.vt100.net/docs/vt520-rm/

Yeah, the current way is fine, but I started using it in my own application, and I missed a way to just reset to the original state.

And ref. the linked discussion in the gnome bugtracker for gnome terminal/vte, the doc is a bit ambigous, so they chose to interpret it in a way that also enables applications to easily reset the cursor style.

And ref. compatibility; this patch makes konsole more compatible with gnome terminal (and the other terminals using vte).

Yeah, the current way is fine, but I started using it in my own application, and I missed a way to just reset to the original state.

And ref. the linked discussion in the gnome bugtracker for gnome terminal/vte, the doc is a bit ambigous, so they chose to interpret it in a way that also enables applications to easily reset the cursor style.

You have a point there; with the way it's implemented now there's no way to reset the cursor style except executing reset, which would most likely be too much.

sandsmark updated this revision to Diff 46841.Dec 4 2018, 4:00 PM

fix format of patch for phabricator

hindenburg accepted this revision.Dec 15 2018, 8:32 PM

I'm inclined to agree since 0 is duplicated - using it as a reset makes sense

This revision is now accepted and ready to land.Dec 15 2018, 8:32 PM
hindenburg edited the summary of this revision. (Show Details)Dec 15 2018, 8:34 PM
This revision was automatically updated to reflect the committed changes.