Reduce complexity and backwards compatibilty a little by removing new aliases

and repurposing "blink".  Improve accuracy of documentation of historical
mistakes and other bugs.

"blink" now means "set the blink attribute for the target(s)" instead of
"set the blink attribute and clear other attributes [and control flags]".
It was even more confusing to use "blinking" for the single attribute to
keep the old meaning for "blink".

"destructive" is not as historically broken or gone as the previous version
said.

The bugs involving resetting from defaults are now understood and partly
documented (the defaults are mis-initialized).
This commit is contained in:
Bruce Evans 2017-08-19 12:14:46 +00:00
parent 49c6edfc84
commit dd51fceb15
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322693
2 changed files with 73 additions and 87 deletions

View File

@ -137,26 +137,38 @@ The following override
.Cm setting Ns s
are available:
.Bl -tag -width indent
.It Cm block
.It Cm normal
Set to a block covering 1 character cell,
with a configuration-dependent coloring
that should be at worst inverse video.
.It Cm blinkingblock
Set to a blinking
.Cm block .
.It Cm underline
Set to
.It Cm destructive
Set to a blinking sub-block with
.Cm height
scanlines starting at
.Cm base .
This only gives an underline in normal configurations.
.It Cm blinkingunderline
Set to a blinking
.Cm underline .
The name
.Dq destructive
is bad for backwards compatibility.
This
.Cm setting
should not force destructiveness,
and it now only gives destructiveness in some
configurations (typically for hardware cursors
in text mode).
Blinking limits destructiveness.
This
.Cm setting
should now be spelled
.Cm normal , Ns Cm blink , Ns Cm noblock .
A non-blinking destructive cursor would be unusable,
so old versions of
.Nm
didn't support it,
and this version doesn't have an override for it.
.It Cm base Ns = Ns Ar value, Cm height Ns = Ns Ar value
Set the specified scanline parameters.
These parameters are only active in so-called
.Cm char ( underline )
These parameters are only active in
.Cm noblock
mode.
.Cm value
is an integer in any base supported by
@ -164,7 +176,7 @@ is an integer in any base supported by
Setting
.Cm height
to 0 turns off the cursor in
.Cm char
.Cm noblock
mode.
Negative
.Ar value Ns s
@ -174,73 +186,57 @@ Positive
are clamped to fit in the character cell when the cursor is drawn.
.El
.Pp
The following override
.Cm setting Ns s
are provided for backwards compatibility:
.Bl -tag -width indent
.It Cm normal
Old name for
.Cm block .
.It Cm blink
Old name for
.Cm blinkingblock .
.It Cm destructive
Bad old name for
.Cm blinkingunderline .
The so-called
.Cm destructive
cursor was only destructive due to a bug that was fixed in
.Fx 4.1.0 .
The destruction in the non-blinking case was so large that
this case was not supported by
.Nm ,
so no backwards compatible name is needed for this case.
.El
.Pp
The following modifier
.Cm setting Ns s
are available:
.Bl -tag -width indent
.It Cm blinking , noblinking
.It Cm blink , noblink
Set or clear the blinking attribute.
.It Cm char , nochar
Set or clear the so-called
.Cm char
This is not quite backwards compatible.
In old versions of
.Nm , Cm blink
was an override to a blinking block.
.It Cm block , noblock
Set or clear the
.Cm block
attribute.
Names in this section follow the bad old names of
flags in the implementation.
.Cm char
now means
.Do
activate the scanline parameters,
and implement them using the best available method
(at worst, actually use the old
.Cm char
method with its destruction fixed if it is configured,
else silently ignore this flag).
.Dc
This attribute is the inverse of the flag
.Dv CONS_CHAR_CURSOR
in the implementation.
It deactivates the scanline parameters,
and expresses a preference for using a
simpler method of implementation.
Its inverse does the opposite.
When the scanline parameters give a full block,
this attribute reduces to a method selection bit.
The
.Cm block
method tends to give better coloring.
.It Cm hidden , nohidden
Set or clear the hidden attribute.
.El
.Pp
The following (non-sticky) flags control application of the
.Cm setting Ns s :
.Bl -tag -width indent
.It Cm local
Apply the changes (except for the
.Cm local
and
.Cm reset
control flags)
to the current vty.
The default is to apply them to all vtys.
Apply the changes to the current vty.
The default is to apply them to a global place
and copy from there to all vtys.
.It Cm reset
Reset everything.
The default is to not reset.
When the
.Cm local
parameter is specified, the resetting is for the
current local settings to the current global settings.
Otherwise, the resetting is for the current global
settings to defaults configured a boot time.
Beware that the scanline parameters and not automatically
scaled by the font size and resetting tends to undo manual
fixups for this.
parameter is specified, the current local settings are reset
to default local settings.
Otherwise, the current global settings are reset to default
global settings and then copied to the current and default
settings for all vtys.
The global defaults are decided (not quite right) at boot time
and cannot be fixed up.
The local defaults are obtained as above and cannot be fixed up
locally.
.El
.It Fl d
Print out current output screen map.

View File

@ -630,36 +630,26 @@ parse_cursor_params(char *param, struct cshape *shape)
param = dupparam = strdup(param);
type = shape->shape[0];
while ((word = strsep(&param, ",")) != NULL) {
if (strcmp(word, "block") == 0)
if (strcmp(word, "normal") == 0)
type = 0;
else if (strcmp(word, "underline") == 0)
type = CONS_CHAR_CURSOR;
else if (strcmp(word, "blinkingblock") == 0)
type = CONS_BLINK_CURSOR;
else if (strcmp(word, "blinkingunderline") == 0)
type = CONS_BLINK_CURSOR | CONS_CHAR_CURSOR;
else if (strncmp(word, "base=", 5) == 0)
shape->shape[1] = strtol(word + 5, NULL, 0);
else if (strncmp(word, "height=", 7) == 0)
shape->shape[2] = strtol(word + 7, NULL, 0);
else if (strcmp(word, "blinking") == 0)
type |= CONS_BLINK_CURSOR;
else if (strcmp(word, "normal") == 0)
type = 0;
else if (strcmp(word, "blink") == 0)
type = CONS_BLINK_CURSOR;
else if (strcmp(word, "destructive") == 0)
type = CONS_BLINK_CURSOR | CONS_CHAR_CURSOR;
else if (strcmp(word, "noblinking") == 0)
else if (strcmp(word, "blink") == 0)
type |= CONS_BLINK_CURSOR;
else if (strcmp(word, "noblink") == 0)
type &= ~CONS_BLINK_CURSOR;
else if (strcmp(word, "char") == 0)
type |= CONS_CHAR_CURSOR;
else if (strcmp(word, "nochar") == 0)
else if (strcmp(word, "block") == 0)
type &= ~CONS_CHAR_CURSOR;
else if (strcmp(word, "noblock") == 0)
type |= CONS_CHAR_CURSOR;
else if (strcmp(word, "hidden") == 0)
type |= CONS_HIDDEN_CURSOR;
else if (strcmp(word, "nohidden") == 0)
type &= ~CONS_HIDDEN_CURSOR;
else if (strncmp(word, "base=", 5) == 0)
shape->shape[1] = strtol(word + 5, NULL, 0);
else if (strncmp(word, "height=", 7) == 0)
shape->shape[2] = strtol(word + 7, NULL, 0);
else if (strcmp(word, "local") == 0)
type |= CONS_LOCAL_CURSOR;
else if (strcmp(word, "reset") == 0)