On Sun, Jan 08, 2023 at 10:34:23PM +0000, Nicholas Marriott wrote:
> > > - Why do you change RS_SCROLLBACK_SCREENS?
> >
> > To more closely mirror xterm behaviour.  The current scrollback buffer is a
> > tiny fraction of what xterm offers by default.  It's not that important,
> > but
> > if we're telling people that the console is now like xterm, it's better
> > that
> > it really is.
> >
> >
> This should be a separate change also.

Sure.

> > Or is it the part in wscons where the underline flag is moved to bit 0?
> > That
> > is a nasty hack that is in the original code.  I could take it out, but
> > that
> > would mean changing all of the bpp specific rasops code and removing the
> > magic
> > number 1 and replacing it with WSATTR_UNDERLINE.
> >
> 
> Yes. WSATTR_UNDERLINE is 8 and you move it to bit 0 in rasops_pack_cattr,
> so can it not be swapped with WSATTR_REVERSE so it is not necessary to move
> it? You are changing rasops to use WSATTR flags in several places, so it
> would be nice if it could use WSATTR_UNDERLINE directly instead of 1.

I agree that this cleanup would be very desireable.

I didn't do it before because it would mean changing files which I have not
yet touched and where breakage might not be as obvious because I'm not
routinely testing on hardware which uses them, (E.G. 4bpp).

But looking at the rest of the rasops and wscons code, I'm wondering if the
values stored in bits 1 and 2 are even used anywhere.  This whole dance of
moving the underline flag to bit 0 seems pointless anyway, because it starts
off in bit 3 which is not being re-purposed.  So it could just be passed to
rasops as WSATTR_UNDERLINE, and the magic number 1 changed.

The way it is at the moment is also tedious for me, because I now need to pass
WSATTR_HILIT to rasops32.c to implement my bold font patch, but it's currently
defined as bit 1 which _is_ being repurposed.

I've just had a casual look through all of the rasops code, including
rasops2.c which has been moved to the attic, and I can't see where these
values are used.

If they are really not used, they should go.  It would make the code cleaner,
and let us just use WSATTR flags everywhere.

> Obviously this should be done as a separate change also and it can wait
> until later, there is enough here already.

Today, 400 lines...  Tomorrow, 4000 lines!!!

> > This is the correct behaviour.  Xterm does the same thing.  Invisible
> > characters retain underline, double underline, and strikethrough.
> >
> 
> Hah, you are right. The terminals I tried do not do this but xterm does.

Yeah, I thought it was odd.  But kind of cool, since otherwise you might as
well just output a space instead of using invisible :-).

> Invisible is useless in any case

The only use I can think of is if you want to type a password or something
at the shell, and not have people look over your shoulder at the screen.

So you can do something like:

# echo ^[[8;4m
# echo 'foobar' > /etc/my_password
# echo ^[[m
# bioctl -c C -l /dev/sd5d -p /etc/my_password

This might have been handy 30 years ago.  Not so much today.

It's much more useful videotext-like terminals, where the attribute affects
all following characters.  So you print something as invisible, then toggle
one bit and suddenly the invisible text appears.

In this case, it is indeed fairly useless.

> but yes if it is supported it should be the same as xterm.

Agreed.

Reply via email to