TitleBar envvar limitations

A forum for general AmigaOS 4.x support questions that are not platform-specific
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

TitleBar envvar limitations

Post by Raziel »

This might already be in the bug (or feature) tracker, i remember telling this to a dev back before this website existed. (Probably Rigo or SSolie, can't remember)

Here we go:
1) In a shell: cd env:
2) 8.Env:> echo 123456789-123456789-123456789-123456789-123456789-123456789-123456789- >test
3) Open Prefs / Workbench
4) Under Screen Title Format, add %e test
5) Click on Test

You will see that the line stops at character 59, the sixth "-" and further won't be displayed.

Why is it limited to 59 chars and not, lets stay with computer arithmetics, 64?
Can it be upped to at least 64? 128 would be even better or an option in the Prefs to enhance it where needed?

The reason is i use Tunenet and it's ability to send the song played to an env var and display those at the TitleBar (env:tunenet/playing) which works great.
If i choose to listen to Radio Stations the information given is longer as they tend to pack the album and interpret in it aswell and as such i loose this information because it gets truncated.

If this is already in the tracker or has already been mentioned (probably even by me) i apologize for the noise.
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
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: TitleBar envvar limitations

Post by xenic »

@Raziel
ENV: is now a device and not an assignment in ram: so the correct commands should be used to set and retrieve environmental variables. I just set an environmental variable with "SetEnv" that is 70 characters long and I read the same variable correctly with "GetEnv". Apparently, Tunenet is writing the variable directly to ENV: as though it were still a normal directory. That's wrong on OS4 so Tunenet needs to be fixed.

Personally, I think that storing temporary data in an environmental variable is a misuse of the environmental mechanism anyway. I think Tunenet needs a tunepup :-)
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: TitleBar envvar limitations

Post by tonyw »

@xenic:

I don't think that is the problem. I think the problem is that the WB only allocates a short text buffer to hold the title string.

I did write a BZ about it years ago after someone else made the same complaint, but I don't remember the outcome. I can't find any reference to it after a short look.
cheers
tony
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: TitleBar envvar limitations

Post by xenic »

@Raziel
Sorry. I totally misunderstood the problem you were reporting. I should have read it twice before responding :-)
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: TitleBar envvar limitations

Post by Raziel »

tonyw wrote:@xenic:

I don't think that is the problem. I think the problem is that the WB only allocates a short text buffer to hold the title string.

I did write a BZ about it years ago after someone else made the same complaint, but I don't remember the outcome. I can't find any reference to it after a short look.
Thanks for the update Mr. w :-)
If you stumble over the outcome or the bug item, could you please notify me?
xenic wrote:@xenic

@Raziel
Sorry. I totally misunderstood the problem you were reporting. I should have read it twice before responding :-)
No problem at all.
Thank you for taking part :-)
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: TitleBar envvar limitations

Post by tonyw »

Hi, sorry for the long wait, I've been away.

I first reported this limitation in Nov 2008 (BZ #4948). I "bumped" it in Feb 2010.

It's only an enhancement, so nothing has happened yet AFAIK.
cheers
tony
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1714
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: TitleBar envvar limitations

Post by nbache »

My current WB title string is 265 characters long. So I don't think the problem is the length of the buffer for the title string. But maybe a buffer specifically for the env variable's content? I only use one %e in mine, and it evaluates to 5 characters.

BTW, shouldn't the env variable name be in quotes in the title string template? It is in mine at least.
Raziel wrote:4) Under Screen Title Format, add %e test
IOW, I'd have used %e "test" in your example.

Best regards,

Niels
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: TitleBar envvar limitations

Post by tonyw »

Indeed, I just checked the available string length using the Workbench prefs and I was able to type in excess of 250 characters (the width of my 1440x900 screen).
There is a mention in the releasenotes of the title string allocation being changed last year, but I don't know if that is related.

So any limitation is not in that area. I'll close my old BZ.
cheers
tony
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: TitleBar envvar limitations

Post by Raziel »

nbache wrote:My current WB title string is 265 characters long. So I don't think the problem is the length of the buffer for the title string. But maybe a buffer specifically for the env variable's content? I only use one %e in mine, and it evaluates to 5 characters.

BTW, shouldn't the env variable name be in quotes in the title string template? It is in mine at least.
Raziel wrote:4) Under Screen Title Format, add %e test
IOW, I'd have used %e "test" in your example.

Best regards,

Niels
It works both, with or without "" (It doesn't matter what i choose, it displays spaces in both cases, but stops at the mentioned size)

The only time i have to use "" is when i want to show a variable in brackets, like so Weather: Clear Skies (16°C) where the corresponding line in Workbench prefs would be Weather: %e weather/weather (%e "weather/temp") otherwise, for some reason, it won't work (i.e. i get a single ( instead of the data)
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
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: TitleBar envvar limitations

Post by salass00 »

Raziel wrote: The only time i have to use "" is when i want to show a variable in brackets, like so Weather: Clear Skies (16°C) where the corresponding line in Workbench prefs would be Weather: %e weather/weather (%e "weather/temp") otherwise, for some reason, it won't work (i.e. i get a single ( instead of the data)
I would assume it doesn't work without quotes there because you don't have en env-var called "weather/temp)".
Post Reply