MAIL on AIX V. 3

Eric Murray ericm at ibmpa.awdpa.ibm.com
Fri Apr 12 05:03:05 AEST 1991


In article <6506 at awdprime.UUCP> geo at george.austin.ibm.com (George Noren) writes:
>In article <1991Apr2.215813.12245 at uvm.edu>, moore at emily.uvm.edu (Bryan
>Moore) writes:
>> 
>> I am having a problem with the mail system on AIX V. 3.
>> Previously on AIX 2.2.1 on the RT, when a user was looking at
>> mail, the system would prompt for a key-press when the screen
>> filled up ( like it was piped into pg). On the RS/6000, the
>> information just scrolls through the mail message even if it
>> is 10 pages long.
>> 
>> Maybe this is a parameter in the .mailrc file, but I don't know
>> which one.
>> 
>
>
>The parameter is:
>
>	set crt=<x>
>
>where <x> is the number of lines in the crt screen (or x-window).  This
>can be put
>in $HOME/.mailrc for each user, or in /usr/lib/Mail.rc for system-wide effect.
>The entry causes the mail program to feed the message through the pg program if
>the message exceeds <x> number of lines.


Even better, you can get the page size to automagically change when you
change your window size:

set crt=`${HOME}/bin/ttylines`




and here's ttylines.c:
(god, I love programs that port directly from BSD!)


/* issue an TIOCGWINSZ ioctl on our pty tp get the window size */
#include <sys/file.h>
#include <sys/ioctl.h>
/*struct winsize { 
**	unsigned short	ws_row;
**	unsigned short	ws_col;
**	unsigned short	ws_xpixel;
**	unsigned short	ws_ypixel;
};*/

main(argc,argv)
int argc;
char **argv;
{
	register int fp, new;
	struct winsize ws;

	fp = open("/dev/tty",O_RDWR,0);

	ioctl(fp,TIOCGWINSZ,&ws);

	if (argc > 1 && ((new = atoi(argv[1])) != ws.ws_row)) {
		/* user wants to set size & it's not right */
		ws.ws_row = new;
		ioctl(fp,TIOCSWINSZ,&ws);
	}

	/* print out rows */
	printf("%d\n",ws.ws_row);

	close(fp);
}
 eric murray         ericm at angst.awdpa.ibm.com      ericm at ibminet.awdpa.ibm.com
 the lawyers make me say: this posting doesn't represent official ibm policy



More information about the Comp.unix.aix mailing list