Re: Converting termcap entries to terminfo entries

2019-10-23 Thread Brian Buhrow
hello Roy.  I must have been tired when I looked at the problem before
writing my message.  Brad suggested I look at the captoinfo program in the
ncurses package again to make sure it actually produced binary output
instead of terminfo source.  In the ncurses package I'm using, from 2016,
captoinfo is a symlink to tic, which may have been part of the issue.  In
any case, I found some formatting issues with my original termcap file that
captoinfo didn't like, and when I fixed them, it produced a file suitable
for your version of tic.  So, vi and other screen using programs are now
working with the window(1) program again.  Thank you to you and Brad for
writing back with such helpful messages.
-thanks
-Brian



Re: Converting termcap entries to terminfo entries

2019-10-23 Thread Roy Marples

Hi Brian

On 22/10/2019 23:14, Brian Buhrow wrote:

hello.  I'm in the process of building NetBSD-9.0 systems in an effort
to consider upgrading from my fleet of NetBSD-5.2 systems to NetBSD-9.  As
a long time window(1) user, I have a termcap entry for the window terminal
type that I use on systems that I ssh into from window(1) panes.  It is my
practice to put a termcap and a terminfo database in my home directory on
such systems, so that regardless of whether a program at the far end wants
termcap or terminfo, it will be able to draw on the screen in full screen
mode.  what I need is a way of converting the termcap entries I have into a
terminfo source file that tic(1) can compile into a .cdb file which can be
used on NetBSD-9 systems.  I have  an older version of captoinfo(1) from
the ncurses pkg, but it produces binary terminfo output unsuitable for the
tic(1) program.  I'm fuly aware that window(1) has been deprecated in favor
of tmux(1), but I haven't climbed the learning curve of tmux(1) yet and I'm
not sure it does everything I get from the window(1) program.
So, can someone tell me what program I should use to convert termcap
files into terminfo source files suitable for the new terminfo libraries in
NetBSD-8 and 9?


We don't have any specific program as such, but terminfo(5) has a 
section "Fetching Compiled Descriptions"


If the environment variable TERMCAP is available and does not begin with
a slash (`/') then it will be translated into terminfo and compiled as
above.  If its name matches TERM then it is used.

So you can use infocmp(8) like so:

$ TERM=captest 
TERMCAP="captest|:al=3*\E^R:am:bl=^G:cd=16*\E^C:ce=16\E^U:cl=2*^L:cm=\Ea%+ 
%+ :" infocmp

# Reconstructed from $TERMCAP
captest,
am,
bel=^G, clear=\f$<2*/>, cr=^M, cud1=^J,
cup=\Ea%p1%{32}%+%c%p2%{32}%+%c, ed=\E\003$<16*/>, el=\E\025$<16/>,
ht=^I, il1=\E\022$<3*/>, ind=^J, kbs=^H, kcub1=^H, kcud1=^J,
nel=^M^J,

I don't know how accurate the conversion will be for you as it's not 
entirely a 1-1 mapping and I think some assumptions are made (I've not 
looked at the source for a while), but hopefully it's good enough.


Might be time consusing with many termcap entries to convert, but it 
should be scriptable at least. Is this good enough for you?


Roy


Converting termcap entries to terminfo entries

2019-10-22 Thread Brian Buhrow
hello.  I'm in the process of building NetBSD-9.0 systems in an effort
to consider upgrading from my fleet of NetBSD-5.2 systems to NetBSD-9.  As
a long time window(1) user, I have a termcap entry for the window terminal
type that I use on systems that I ssh into from window(1) panes.  It is my
practice to put a termcap and a terminfo database in my home directory on
such systems, so that regardless of whether a program at the far end wants
termcap or terminfo, it will be able to draw on the screen in full screen
mode.  what I need is a way of converting the termcap entries I have into a
terminfo source file that tic(1) can compile into a .cdb file which can be
used on NetBSD-9 systems.  I have  an older version of captoinfo(1) from
the ncurses pkg, but it produces binary terminfo output unsuitable for the
tic(1) program.  I'm fuly aware that window(1) has been deprecated in favor
of tmux(1), but I haven't climbed the learning curve of tmux(1) yet and I'm
not sure it does everything I get from the window(1) program.
So, can someone tell me what program I should use to convert termcap
files into terminfo source files suitable for the new terminfo libraries in
NetBSD-8 and 9?
-thanks
-brian