Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Teaching zsh about a term variable?

Vincent Lefevre wrote:
> On 2004-08-05 13:34:46 -0700, Mac Mason wrote:
> > So, does anybody know where in the myriad config files I should say
> > "hey, zsh, look here for more terminal definitons" and what the syntax
> > of that would be?
> Perhaps the TERMINFO environment variable?

Yes, that's usually the way to go.  Actually, it's probably something
simple if it works in tcsh.  But here's how to set it up from scratch.

I have

export TERMINFO=~/lib/terminfo

and the directory ~/lib/terminfo contains

c v x

with entries for cygwin, vs100 and xterm respectively.  The files are
compiled with `tic' (which uses $TERMINFO to find out where to put the
files).  You can can get a source file from a similar terminal (if you
know what one is) using `infocmp -I similar-term', which you can edit.

Of course, knowing how the terminal works is another matter.  Here's the
source for the xterm entry I use on Solaris which (apparently) supports
colour, output with infocmp -I.

#	Reconstructed via infocmp from file: /home/pws/lib/terminfo/x/xterm
xterm|vs100|xterm terminal emulator,
	am, km, mir, msgr, xenl,
	cols#80, it#8, lines#65,
	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J,
	cr=\r, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\b,
	cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
	dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
	ed=\E[J, el=\E[K, el1=\E[1K$<3>, enacs=\E(B\E)0,
	home=\E[H, ht=\t, hts=\EH, ich=\E[%p1%d@, ich1=\E[@,
	il=\E[%p1%dL, il1=\E[L, ind=\n, ka1=\EOq, ka3=\EOs,
	kb2=\EOr, kbs=\b, kc1=\EOp, kc3=\EOn, kcub1=\EOD,
	kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kent=\EOM,
	kf0=\E[21~, kf1=\E[11~, kf10=\EOx, kf2=\E[12~,
	kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~,
	kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, rc=\E8, rev=\E[7m,
	ri=\EM, rmacs=^O, rmkx=\E[?1l\E>, rmso=\E[m,
	rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, rs2=@,
	sgr0=\E[m, smacs=^N, smkx=\E[?1h\E=, smso=\E[7m,
	smul=\E[4m, tbc=\E[3g,

Here's `infocmp -I xterm-color' from Fedora Core 2.

#       Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-color
xterm-color|nxterm|generic color xterm, 
        am, xenl, km, mir, msgr, 
        cols#80, it#8, lines#24, colors#8, pairs#64, ncv@, 
        bel=^G, cr=^M, csr=\E[%i%p1%d;%p2%dr, tbc=\E[3g, 
        clear=\E[H\E[2J, el=\E[K, ed=\E[J, cup=\E[%i%p1%d;%p2%dH, 
        cud1=^J, home=\E[H, cub1=^H, cuf1=\E[C, cuu1=\E[A, dch1=\E[P, 
        dl1=\E[M, enacs=\E)0, smacs=^N, bold=\E[1m, 
        smcup=\E7\E[?47h, smir=\E[4h, rev=\E[7m, smso=\E[7m, 
        smul=\E[4m, rmacs=^O, sgr0=\E[m, rmcup=\E[2J\E[?47l\E8, 
        rmir=\E[4l, rmso=\E[m, rmul=\E[m, 
        il1=\E[L, kbs=^H, kdch1=\E[3~, kcud1=\EOB, kf1=\E[11~, 
        kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, 
        kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, 
        kf18=\E[32~, kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, 
        kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, 
        kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, 
        kcub1=\EOD, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kcuf1=\EOC, 
        kslt=\E[4~, kcuu1=\EOA, rmkx=\E[?1l\E>, smkx=\E[?1h\E=, 
        op=\E[m, dch=\E[%p1%dP, dl=\E[%p1%dM, cud=\E[%p1%dB, 
        il=\E[%p1%dL, cub=\E[%p1%dD, cuf=\E[%p1%dC, 
        rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, rc=\E8, 
        sc=\E7, ind=^J, ri=\EM, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 
        hts=\EH, ht=^I, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, 

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


Messages sorted by: Reverse Date, Date, Thread, Author