Subject: Re: Curses and function-keys
To: Julian Coleman <jdc@coris.org.uk>
From: David Laight <david@l8s.co.uk>
List: netbsd-users
Date: 01/15/2006 16:01:06
On Sun, Jan 15, 2006 at 03:52:57PM +0000, Julian Coleman wrote:
> 
> When I run the program in an xterm, I do see colours, but the keys aren't
> recognised.  This is because, for our curses, it needs to call cbreak() - I
> added this call just after the noecho() line in init_curses().  Possibly, we
> should default to cbreak mode when initscr() is called.

From: http://www.opengroup.org/onlinepubs/007908799/xcurses/intov.html#tag_001_005_002

The initial input mode for Curses operations is unspecified  unless the implementation supports Enhanced Curses compliance, in which the initial input mode is cbreak mode. 

(Every version I've ever used starts in 'cooked' mode.)

>   it calls start_color() and doesn't check the return code, so it will try
>   and use colours on terminals that don't support colour (e.g. vt100).

IMHO curses ought to treat colour changes as noops is start_color() fails.

>   it deletes the items[0] window and then tries to delete the sub-windows of
>   that window.  This causes our curses code to go into a loop.  I'll look at
>   fixing this.

Clearly broken program behaviour....

	David

-- 
David Laight: david@l8s.co.uk