removing UA windows from shell

Dave Jenks cs255113 at csusac.csus.edu
Mon Nov 13 16:33:54 AEST 1989


I had a similar problem getting my system to a "usable" state, so
I wrote a little utility to clean up the window environment.  It
works by creating a full-screen window with no border, then "leaving
you out in the lurch" like ua does, only the offending window is the
whole screen.  Be sure to check your console settings with stty -a.
It is appropriately named "windex".  Compile the following listing with:

	cc windex.c -o windex -ltam -ltermcap

Hope it works as well for you.  Here it is:


#include <stdio.h>
#include <tam.h>


/* clear any window crap left on the screen */

main(argc, argv)
int	argc;
char	*argv[];
{
    short		wn;
    unsigned short	flags;

    winit();
    flags = NBORDER & ~BORDHSCROLL & ~BORDVSCROLL;
    flags &= (~BORDHELP & ~BORDCANCEL & ~BORDRESIZE);
    if ((wn = wcreate(1, 0, 24, 80, flags)) == -1)
    {
	fprintf(stderr, "%s: error creating window\n", argv[0]);
	wexit(1);
    }
    clear();			/* clear window (lines 2-25) */
    wprompt(wn, "");		/* clear prompt line (26) */
    wcmd(wn, "");		/* clear cmd line (27) */
    wslk(wn, 0, "", "", "");	/* clear screen keys (lines 28 & 29) */
    wrefresh(wn);
    wgoto(wn, 0, 0);
    wexit(0);
}



More information about the Unix-pc.general mailing list