[comp.lang.c] Small curses test program

syspgm%ritcv@cs.rit.edu (06/26/89)

	A while back I ran across a problem with the curses routine getstr.
Getstr in some operating systems' implementations disables the backspace/delete
key. I have since determined that the routine works on System V 
but does not work on Sun OS or Ultrix machines. I am curious if anyone with
later versions of these operating systems has any luck with the following
short program.

	Sun O.S. 4.0		(Sun 50/60 workstations)	-- NO
	Ultrix-32 V3.0		(Vax 11/780)			-- NO
	Unix System V/386	(AT&T 6386)			-- YES
	Unix System V 3.1.1	(AT&T 3B2 600)			-- YES
	VMS 5.1			(VAX 8800 cluster)		-- YES

### cut here
#include <curses.h>

/*
**  Dean S. Blodgett	Rochester Institute of Technology
**
**  the question is does this program allow you to use the backspace/delete
**  key without having ^H or ^? echoed to the screen and is the backspace
**  delete key functional ?
*/

main()

   {
   char line[132];

   initscr();
   getstr(line);
   printw("%s\n",line);
   refresh();
   endwin();
   }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
| Dean Scott Blodgett		   |	Make it in Massachusetts,	       |
| Rochester Institute of Technology|    Spend it in New Hampshire	       |
| e-mail: cs.rit.edu		   |    (Go Sox)			       |

usenet@cps3xx.UUCP (Usenet file owner) (06/29/89)

in article <1173@cs.rit.edu$, syspgm%ritcv@cs.rit.edu says:
$ 
$ 
$ 	A while back I ran across a problem with the curses routine getstr.
$ Getstr in some operating systems' implementations disables the backspace/delete
$ key. I have since determined that the routine works on System V 
$ but does not work on Sun OS or Ultrix machines. I am curious if anyone with
$ later versions of these operating systems has any luck with the following
$ short program.
$ 
$ main()
$ 
$    {
$    char line[132];
$ 
$    initscr();
$    getstr(line);
$    printw("%s\n",line);
$    refresh();
$    endwin();
$    }

I suspect the problem is with Sys V using terminfo while the Berkeley
flavors use termcap. For kicks, I tried the test program under 
SCO XENIX 386 v2.3.1. Xenxix provides both termcap and terminfo. Using
terminfo, it worked fine. Using termcap, the program wouldn't work.
(it started up, but didn't clear the screen, interupting out of 
the program, I found I needed to kill myself..)

John H. Lawitzke           UUCP: Work: ...uunet!frith!dale1!jhl
Dale Computer Corp., R&D         Home  ...uunet!frith!ipecac!jhl
2367 Science Parkway       Internet:   jhl@frith.egr.msu.edu
Okemos, MI, 48864                             [35.8.8.108]

gwyn@smoke.BRL.MIL (Doug Gwyn) (07/12/89)

In article <3587@cps3xx.UUCP> usenet@cps3xx.UUCP (Usenet file owner) writes:
>(it started up, but didn't clear the screen, interupting out of 
>the program, I found I needed to kill myself..)

Don't do it -- it's not THAT bad!