Add support for Set Cursor Style (DECSCUSR) escape sequences
ClosedPublic

Authored by ahmadsamir on Apr 14 2018, 11:49 AM.

Details

Summary

This follows the XTerm escape sequences, which include a couple more
shapes than what VT520 supports.

BUG: 347323
FIXED-IN: 18.08

Test Plan

To test the escape sequences:
printf '\e[ q' #blinking block
printf '\e[0 q' # blinking block
printf '\e[1 q' # blinking block
printf '\e[2 q' # steady block
printf '\e[3 q' # blinking underscore
printf '\e[4 q' # steady underscore
printf '\e[5 q' # blinking ibeam/bar
printf '\e[6 q' # steady ibeam/bar

Executing reset in terminal will reset the cursor shape and blinking
settings to the current profile values.

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.
ahmadsamir created this revision.Apr 14 2018, 11:49 AM
Restricted Application added a project: Konsole. · View Herald TranscriptApr 14 2018, 11:49 AM
Restricted Application added a subscriber: Konsole. · View Herald Transcript
ahmadsamir requested review of this revision.Apr 14 2018, 11:49 AM

The output looks great - was mimicking xterms '\e[ q' too hard or not worth the effort? Also, it would be good if you could fill out the "testing" part; for example, you could copy/paste the printf commands from the bug report.

ahmadsamir updated this revision to Diff 32453.Apr 18 2018, 9:43 AM
ahmadsamir edited the test plan for this revision. (Show Details)

Add test plan section

ahmadsamir updated this revision to Diff 32454.Apr 18 2018, 9:46 AM
ahmadsamir edited the test plan for this revision. (Show Details)

Update diff again because some bits of the commit message were wrongly commented out

ahmadsamir updated this revision to Diff 32456.Apr 18 2018, 9:49 AM
ahmadsamir edited the test plan for this revision. (Show Details)

Add note about 'reset' to the test section

The output looks great - was mimicking xterms '\e[ q' too hard or not worth the effort?

I am not sure what you mean, but if you mean the code in the Vt102Emulation, it took me a long time to understand the 'lec' and co. parts, and a lot of trial and error; the comment at the top of that section says "Ok, here comes the nasty part of the decoder.", which is true, it's quite nasty.

Also, it would be good if you could fill out the "testing" part; for example, you could copy/paste the printf commands from the bug report.

OK, I fleshed out the test plan section a bit.

In xterm, the number 0 or omitting the number is the same as number 1.

In vte we intentionally differ, the number 0 or omitting the number means to revert to the default (the shape is taken from profile prefs, blinking is from GNOME-wide setting).


I tested omitting the # in xterm and it works as if there was 1 - I think we'd rather follow xterm than vte ATM

In xterm, the number 0 or omitting the number is the same as number 1.

In vte we intentionally differ, the number 0 or omitting the number means to revert to the default (the shape is taken from profile prefs, blinking is from GNOME-wide setting).


I tested omitting the # in xterm and it works as if there was 1 - I think we'd rather follow xterm than vte ATM

Ah, sorry, I didn't get what you meant before.

I'll see what I can do, might as well be fully compatible with xterm regarding the cursor style.

ahmadsamir updated this revision to Diff 32478.Apr 18 2018, 3:14 PM
ahmadsamir edited the test plan for this revision. (Show Details)

Support 'ESC[ q' too

hindenburg accepted this revision.Apr 19 2018, 1:37 PM

Thanks looks good

This revision is now accepted and ready to land.Apr 19 2018, 1:37 PM
This revision was automatically updated to reflect the committed changes.

I notice that using 'reset' in FreeBSD does not change the cursor back to profile setting.

I notice that using 'reset' in FreeBSD does not change the cursor back to profile setting.

reset on my box is provided by ncurses-6.0; does BSD has something different?

From what I can tell, they are different programs. It is not a show stopper, just a note.