console control codes in 4.1FE

A forum for general AmigaOS 4.x support questions that are not platform-specific
lazi
Posts: 45
Joined: Sat Jun 18, 2011 8:46 am

console control codes in 4.1FE

Post by lazi »

Hi!

I am going to release an update to PDFToolkit, but found that the program looks broken in 4.1FE consoles.

I present the problem with a simple echo command in the shell.
Here is a picture from the UAE 3.1 installation (it is the same on 4.1 update 6, but I can't boot it now):
Image

And here is the OS4.1FE result with the a same control codes:
Image

You can see the the background color is rewritten from the first character in the row instead of just for the printed characters.
If it is an intended change, I have to find a workaround.
Can't found anything about the change.

Please let me know the reason of the new behaviour.


Thanks!

Edit: changed the url of the images
Last edited by lazi on Fri Dec 25, 2020 1:31 pm, edited 1 time in total.
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: console control codes in 4.1FE

Post by tonyw »

That is not an intended change and could be a bug.

I'll take a look at it.

(time passes)

I confirm that it is a bug, submitted as #9193.
cheers
tony
lazi
Posts: 45
Joined: Sat Jun 18, 2011 8:46 am

Re: console control codes in 4.1FE

Post by lazi »

Thank you very much!
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: console control codes in 4.1FE

Post by tonyw »

OK, I've found the fault and fixed it, but I haven't released it to the betatesters yet.

The fixed version will not be released to the public for some time, so I suggest that you invoke a work-around anyway.

The problem is caused by the order of the operations:
1. Change background colour;
2. Position cursor to new place past the end of the line;
3. Fill with new spaces from the end of the line to where the new text is going;
4. Write the new text ("oo"" in your example).

Step 3 fills the line with spaces, but the new "fill" spaces are written in the new background colour. If you are over-writing existing characters, the problem does not occur, it only occurs when filling past the end of a line.

One work-around that I recommend is to change the order of operations:

if (new place is past the end of the line)
{
move cursor to end of line;
draw spaces until you get to the new place;
}
else
move cursor to new place;
change background and/or foreground colours;
write the new text.

That should work OK.
cheers
tony
User avatar
trixie
Posts: 409
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: console control codes in 4.1FE

Post by trixie »

tonyw wrote:The fixed version will not be released to the public for some time
The reason being... what?
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: console control codes in 4.1FE

Post by tonyw »

It takes time for a changed component to be submitted to all the regression testing that the betatesters do. The few times that we have released "quick fixes" without going through the betatest stage, have all led to unanticipated problems.

At a guess, I would say a couple of months minimum before we are confident enough of this change, to release it. I don't know how that lines up with any planned updates.
cheers
tony
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: console control codes in 4.1FE

Post by Raziel »

@tonyw

I found another strange behaviour with ESC colouring.

Code: Select all

echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
Try the attached example (simple) in a complete empty shell window (cls)
Everything works fine.
The first text is on a white background, the second text is normal and the third text (if printed) is on a light gray background.

Once the printout reaches the bottom of the shell and starts scrolling though, the light gray background is filling up the entire width of the line where it shouldn't even be printed/used at all (on the lines where no "second inbetween" text is printed - there isn't even the ESC code sequence in those lines).

Image
Link to picture

Could you please check and maybe add it to the bug report?

Thanks a lot
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: console control codes in 4.1FE

Post by tonyw »

Yes, I'm aware of that one and working on it atm. It's the same as appears on the end of the 4th line in lazi's original post.
cheers
tony
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: console control codes in 4.1FE

Post by Raziel »

Thank you :-)
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
lazi
Posts: 45
Joined: Sat Jun 18, 2011 8:46 am

Re: console control codes in 4.1FE

Post by lazi »

Hi!

After the FE update my machine have this:
con-handler 53.78
console.device 53.99

The problem is the same as you can see in post #1.

Bye!
Post Reply