Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-11-04 Thread Jamie Landeg-Jones
Steffen Nurpmeso  wrote:

> You know the entire thread is moot as i think bapt@ has thrown
> away the BSD termcap years ago, if i recall correctly (i think
> i spoke up by then).
> I only answered because of the "great it is gone" thing.

Maybe I should have rephrased that as "it's great that we only
now have one to deal with, that is the same as most other
POSIX systems use."

It was not a dig against termcap per se.

Jamie



Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-11-03 Thread Steffen Nurpmeso
Hello Thomas Dickey.

Thomas Dickey wrote in
 :
 |On Thu, Nov 02, 2023 at 06:58:55PM +0100, Steffen Nurpmeso wrote:
 |> I do understand that a bit.  Other than that plain termcap was so
 |> small and i would assume essentially unchanged for decades, that
 |> i do not.  Termcap entries, yes.  I could imagine vt220, xterm,
 |> screen-256color, and take one of st-256color, whatever KDE and
 |> GNOME terminal, and rxvt-unicode.  Makes seven.  Likely
 |> automatically extractable via "infocmp -C" of Dickey's terminfo.
 |> 
 |> Let's just try that:
 |> 
 |>   $ rm .TCAP;\
 |> for f in vt220 xterm screen-256color st-256color \
 |> rxvt-256color gnome-256color konsole-256color; do \
 |>   infocmp -C $f >> .TCAP;\
 |> done;\
 |> ls -l .TCAP
 |>   -rw-r- 1 steffen steffen 7145 Nov  2 18:40 .TCAP
 |
 |There's more data in termcap than that (which some people would like \
 |to use).

You know the entire thread is moot as i think bapt@ has thrown
away the BSD termcap years ago, if i recall correctly (i think
i spoke up by then).
I only answered because of the "great it is gone" thing.

 |And there's additional data for terminfo -- again, some want it.
 |
 |man infocmp:
 |
 |   For best results when converting to termcap format, you should \
 |   use both
 |   -C  and  -r.   Normally a termcap description is limited to \
 |   1023 bytes.

And i do not know whether BSD termcap can work with larger ones.

 |   infocmp trims away less essential parts to make it  fit.   If \
 |you  are
 |   converting to one of the (rare) termcap implementations which \
 |   accept an
 |   unlimited size of termcap, you may want to add the -T option. \

Yes.  I heard about the limit.

 |More of‐
 |   ten  however, you must help the termcap implementation, and \
 |   trim excess
 |   whitespace (use the -0 option for that).
 |
 |(-T is appropriate here - ymmv)
 |
 |With -C alone, I get
 |-rw--- 1 tom users 7315 Nov  2 21:02 .TCAP
 |
 |With -CrT,
 |-rw--- 1 tom users 14390 Nov  2 21:02 .TCAP
 |
 |For terminfo, no options
 |-rw--- 1 tom users 16027 Nov  2 21:03 .TCAP
 |
 |For terminfo with -x
 |-rw--- 1 tom users 19533 Nov  2 21:03 .TCAP

One would have to add that OpenGL-accelerated terminal (allacritty
or so) at least, too.

I am not speaking against your ncurses and the work and effort you
put there, you know, i spent about 30% of my live in front of
a st/tmux combination, and i would think tmux uses more and more
of the optimizations, and improvements of yours.  For example
i saw fly by an OpenBSD commit where tmux started using tparm_s or
what its name was.  They imported some ncurses snapshot only for
it (in the end), if i got that right.  The function is not on my
box -- and i do not "track" ncurses no more because i will likely
never reach a point where i need it as such.

I was speaking pro BSD termcap.  I do not know whether even the
omnipresent readline library would need anything more than the
absolute basics.  I know my mailer can, .. it can even without
termcap, .. at least a little bit, and very expensive.  (I have
not tried that out for years so.)

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-11-02 Thread Thomas Dickey
On Thu, Nov 02, 2023 at 06:58:55PM +0100, Steffen Nurpmeso wrote:
> I do understand that a bit.  Other than that plain termcap was so
> small and i would assume essentially unchanged for decades, that
> i do not.  Termcap entries, yes.  I could imagine vt220, xterm,
> screen-256color, and take one of st-256color, whatever KDE and
> GNOME terminal, and rxvt-unicode.  Makes seven.  Likely
> automatically extractable via "infocmp -C" of Dickey's terminfo.
> 
> Let's just try that:
> 
>   $ rm .TCAP;\
> for f in vt220 xterm screen-256color st-256color \
> rxvt-256color gnome-256color konsole-256color; do \
>   infocmp -C $f >> .TCAP;\
> done;\
> ls -l .TCAP
>   -rw-r- 1 steffen steffen 7145 Nov  2 18:40 .TCAP

There's more data in termcap than that (which some people would like to use).
And there's additional data for terminfo -- again, some want it.

man infocmp:

   For best results when converting to termcap format, you should use both
   -C  and  -r.   Normally a termcap description is limited to 1023 bytes.
   infocmp trims away less essential parts to make it  fit.   If  you  are
   converting to one of the (rare) termcap implementations which accept an
   unlimited size of termcap, you may want to add the -T option.  More of‐
   ten  however, you must help the termcap implementation, and trim excess
   whitespace (use the -0 option for that).

(-T is appropriate here - ymmv)

With -C alone, I get
-rw--- 1 tom users 7315 Nov  2 21:02 .TCAP

With -CrT,
-rw--- 1 tom users 14390 Nov  2 21:02 .TCAP

For terminfo, no options
-rw--- 1 tom users 16027 Nov  2 21:03 .TCAP

For terminfo with -x
-rw--- 1 tom users 19533 Nov  2 21:03 .TCAP

-- 
Thomas E. Dickey 
https://invisible-island.net


signature.asc
Description: PGP signature


Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-11-01 Thread Jamie Landeg-Jones
Steffen Nurpmeso  wrote:

> Why?
> (That is to say: why -- if it is a *real* termcap?  If it is only
> a translation layer to terminfo, i am with you.  But otherwise
> not, i think a real termcap is much, much smaller, while offering
> anything a (simple) console program needs.)
> That is not to talk small the efforts of Mr. Dickey.  But for
> example the mailer i maintain *can* directly use BSD termcap if so
> desired, and it works just nice.

I agree that termcap does most of what we need already, so my main
reason is that there are 2 different systems in use to do the same
job, which is annoying. (FreeBSD doesn't exist in a vacuum) As terminfo
exists, is supported, and has terminal entries that our termcap doesn't
have, it seems to be better to switch to that. I'm sure it would mean
less maintenance for the FreeBSD committers too.

If terminfo didn't exist, I'd live with termcap.

There are also benefits to terminfo:

https://invisible-island.net/ncurses/ncurses.faq.html#extended_term

We don't even run with a "proper" termcap anyway!

"The base system's terminal database is referred to as “termcap.db”
but is actually an ncurses terminfo hashed database." -  
https://invisible-island.net/ncurses/ncurses.faq.html#what_platforms

So, yeah, despite Mr Dicky's success in making working with both as seamless
as possible ,it would still just be nice to not have to deal with 2 different
standards, that's all.

"setaf or AF, that is the question."

Cheers, Jamie



Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-11-01 Thread Jamie Landeg-Jones
Baptiste Daroussin  wrote:

> If you don't install (terminfo-db which nothing should pull in by default), 
> then
> you are on the default behaviour which is termcap, this has been made like 
> this
> on purpose, by default you have the behaviour you have always expected, and if
> you want another behaviour and larger support you install terminfo-db.
>
> The fact that tcsh does not play nicely with terminfo, is nother problem.

Thanks for the clarification. I had mistakingly thought many things pulled in
terminfo-db, but it appears to be only deskutils/arttime that does so, so it's
not as serious as I thought.

As for tcsh, I'll work on getting it fixed upstream.

Cheers, Jamie



Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-11-01 Thread Baptiste Daroussin
On Wed, Nov 01, 2023 at 03:49:33AM +, Jamie Landeg-Jones wrote:
> Thomas Dickey  wrote:
> 
> > actually it probably does affect "xterm" 
> >
> > Checking the source, tcsh is expecting a termcap string, while data read
> > from the terminfo database is going to be in terminfo format -- even if
> > read via tgetent/tgetstr
> >
> > tcsh is expecting a termcap string, and in its EchoTC function it duplicates
> > the termcap version of what's tparm in a terminfo program.
> >
> > (tcsh could be modified readily to use terminfo for the case you're 
> > describing,
> >  but supporting $TERMCAP would be work)
> 
> Hi Thomas, thanks for the reply... from the ncurses man himself!
> 
> I *thought* I'd seen issues with just "xterm" but after posting the first
> message, it seemed to start working, and so I doubted myself, but I must
> have messed up somewhere!
> 
> What threw me about tcsh is it does mention terminfo in the man page and
> the source, so I wrongly assumed the problem wasn't there.
> 
> Anyway, I'll raise it with the tcsh maintainers.
> 
> To the FreeBSD release folk, I think it's great that we're moving off termcap,
> but is there a chance that base tcsh could be compiled with a private version
> of the terminfo-less ncurses in time for 14.0-RELEASE, if a proper fix to tcsh
> is going to take too long?
> 
> Thanks again, Thomas.
> 
> Cheers, Jamie

If you don't install (terminfo-db which nothing should pull in by default), then
you are on the default behaviour which is termcap, this has been made like this
on purpose, by default you have the behaviour you have always expected, and if
you want another behaviour and larger support you install terminfo-db.

The fact that tcsh does not play nicely with terminfo, is nother problem.

Best regards,
Bapt



Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-10-31 Thread Jamie Landeg-Jones
Thomas Dickey  wrote:

> actually it probably does affect "xterm" 
>
> Checking the source, tcsh is expecting a termcap string, while data read
> from the terminfo database is going to be in terminfo format -- even if
> read via tgetent/tgetstr
>
> tcsh is expecting a termcap string, and in its EchoTC function it duplicates
> the termcap version of what's tparm in a terminfo program.
>
> (tcsh could be modified readily to use terminfo for the case you're 
> describing,
>  but supporting $TERMCAP would be work)

Hi Thomas, thanks for the reply... from the ncurses man himself!

I *thought* I'd seen issues with just "xterm" but after posting the first
message, it seemed to start working, and so I doubted myself, but I must
have messed up somewhere!

What threw me about tcsh is it does mention terminfo in the man page and
the source, so I wrongly assumed the problem wasn't there.

Anyway, I'll raise it with the tcsh maintainers.

To the FreeBSD release folk, I think it's great that we're moving off termcap,
but is there a chance that base tcsh could be compiled with a private version
of the terminfo-less ncurses in time for 14.0-RELEASE, if a proper fix to tcsh
is going to take too long?

Thanks again, Thomas.

Cheers, Jamie



Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-10-31 Thread Thomas Dickey
On Tue, Oct 31, 2023 at 10:59:48PM +, Jamie Landeg-Jones wrote:
> Jamie Landeg-Jones  wrote:
> 
> > switch to tcsh, and reinitialise terminal information:
> >
> > % setenv TERM dumb
> > % setenv TERM xterm
> 
> % setenv TERM xterm-256color
> 
> Apologies, it seems this doesn't affect plain "xterm", but it does at least 
> affect xterm-16color and xterm-256color.

actually it probably does affect "xterm" 

Checking the source, tcsh is expecting a termcap string, while data read
from the terminfo database is going to be in terminfo format -- even if
read via tgetent/tgetstr

tcsh is expecting a termcap string, and in its EchoTC function it duplicates
the termcap version of what's tparm in a terminfo program.

(tcsh could be modified readily to use terminfo for the case you're describing,
 but supporting $TERMCAP would be work)
 
> Is this, therefore, a terminfo.db issue?
> 
> Thanks again, Jamie
> 

-- 
Thomas E. Dickey 
https://invisible-island.net


signature.asc
Description: PGP signature


Re: Freebsd 14+ -- tcsh incompatible with terminfo

2023-10-31 Thread Jamie Landeg-Jones
Jamie Landeg-Jones  wrote:

> switch to tcsh, and reinitialise terminal information:
>
> % setenv TERM dumb
> % setenv TERM xterm

% setenv TERM xterm-256color

Apologies, it seems this doesn't affect plain "xterm", but it does at least 
affect xterm-16color and xterm-256color.

Is this, therefore, a terminfo.db issue?

Thanks again, Jamie