Date: Sun, 24 Apr 2005 01:50:26 GMT From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/80256: /rescue/vi doesn't work without terminal database in /usr Message-ID: <200504240150.j3O1oQ0c044507@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/80256; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: "Simon L. Nielsen" <simon@FreeBSD.org> Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/80256: /rescue/vi doesn't work without terminal database in /usr Date: Sun, 24 Apr 2005 11:40:39 +1000 (EST) On Sat, 23 Apr 2005, Simon L. Nielsen wrote: > On 2005.04.23 17:19:17 +0200, Brian Candler wrote: > > I do note however from ncurses(3X): > >=20 > > If the ncurses library has been configured with termcap sup= > port, > > ncurses will check for a terminal's description in termcap fo= > rm if > > it is not available in the terminfo database. > >=20 > > This suggests a very simple solution (untested): > >=20 > > --- lib/libncurses/pathnames.h.orig Sat Apr 23 17:17:01 2005 > > +++ lib/libncurses/pathnames.h Sat Apr 23 17:17:13 2005 > > @@ -34,5 +34,5 @@ > > * $FreeBSD: src/lib/libncurses/pathnames.h,v 1.1 1999/08/30 07:57:50 pe= > ter Exp $ > > */ > > =20 > > -#define _PATH_DEF ".termcap /usr/share/misc/termcap" > > +#define _PATH_DEF ".termcap /usr/share/misc/termcap /rescue/termcap" > > #define _PATH_DEF_SEC "/usr/share/misc/termcap" > >=20 > > and then bundle a few termcap entries in /rescue/termcap. Is there any > > reason why that couldn't be done? > > Without knowing how the code in question works, that does sounds like > a simple way to get working vi in a rescue environment. Why not use the normal mechanism? Environment variables exist so that you don't have to hard-code paths into utilities. From environ(7): %%% TERMCAP The string describing the terminal in TERM, or, if it begins with a '/', the name of the termcap file. See TERMPATH below, and termcap(5). TERMPATH A sequence of pathnames of termcap files, separated by colons or spaces, which are searched for terminal descrip- tions in the order listed. Having no TERMPATH is equivalent to a TERMPATH of ``$HOME/.termcap:/etc/termcap''. TERMPATH is ignored if TERMCAP contains a full pathname. %%% Or you can use ".termcap" (maybe using a special $HOME for rescue) without changing ther defaults. There is also some documentation of TERMCAP and TERMPATH in termcap(5). This gives a few less details than the above, and points to termcap(3). termcap(3) used to have a few more details than the above, but has rotted and now doesn't say anything about the environment variables. The details are still in the Attic (libterm/Attic/termcap.3,v). Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504240150.j3O1oQ0c044507>