This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ncurses/terminfo problems


There is no official cygwin ncurses.  I uploaded a test version a few
weeks ago, and was soliciting comments.  Thank you for debugging the
problems you found.  Pending confirmation of your diagnoses, I'll try to
add these items to the next test release of ncurses for cygwin.

However, point #3 below is wrong.  (Remember, we're dealing with VERY
preliminary dll support for cygwin-ncurses -- I only finished "porting"
it 10 days ago).  NCURSES_DLL means "I am building the dll itself". 
NCURSES_STATIC means "I am building the static library or I am building
an object that will later be linked with the static library".  Defining
neither is the RIGHT thing to do -- it means "I am building an object
that will later be linked with the dll".  This information is already
described in /usr/doc/Cygwin/ncurses-5.2.README.

IMO, port-specific stuff should NOT go into the man page.  The man page
should contain generic information about the package that is true for
all platforms.  Port-specific stuff should go somewhere else -- on
cygwin, that's /usr/doc/Cygwin/*

--Chuck
 
Ehud Karni wrote:
> 
> Last week (Nov 14) I asked a question about TCGETS/TCSETS in cygwin,
> I haven't received even a single answer. Since then I have encountered
> some other problem with ncurses on cygwin. I solved all of them by now
> and I have some observations.
> 
> The problems were:
> 1. No support for the ioctl call with TCGETS/TCSETS to get/set
>    termios structure onto terminals in cygwin.
> Solution:
>    It seems that with cygwin ncurses TCGETA/TCSETA does exactly what I
>    used to do with TCGETS/TCSETS. In the Linux ioctl_list man page
>    TCGETS/TCSETS works on termios structure while TCGETA/TCSETA work on
>    termio structure. In the cygwin porting termio and termios are
>    exactly the same.
> Required action: Defining TCGETS and TCSETS to be the same as TCGETA and
>    TCSETS on the cygwin porting, Adding the above facts to the FAQ,
>    README and the ioctl man page (which is missing in cygwin).
> 
> 2. When calling setupterm the environment variables LINES and
>    COLUMNS are not considered [ like a call to use_env(FALSE) has
>    been done ] contrary to the Man page.
> Solution:
>    The cause is the function `_nc_get_screensize'. It checks both LINES
>    and COLUMNS environment variables and if BOTH are set then their
>    value is used (if ONLY one is set, it is ignored). Since I use cygwin
>    bash in console mode I just set the LINES to 43 which of course did
>    not work (my script on UNIX always sets both variables). the relevant
>    part of the man page of ncurses is:
> 
>  Either COLUMNS or LINES symbols may be specified independently. This
>  is mainly useful to circumvent legacy misfeatures of terminal descr-
>  iptions, e.g., xterm which commonly specifies a 65 line screen.  For
>  best results,  lines and cols  should not be specified in a terminal
>  description for terminals which are run as emulations.
> 
> The following patch fix this problem:
> 
> diff -c ORIGINAL/ncurses-5.2/ncurses/tinfo/lib_setup.c  ~/lib_setup.c
> *** ORIGINAL/ncurses-5.2/ncurses/tinfo/lib_setup.c  Sat Sep  2 21:13:12 2000
> --- ~/lib_setup.c                                   Sun Nov 19 01:11:37 2000
> ***************
> *** 165,174 ****
>   #endif /* HAVE_SIZECHANGE */
> 
>         /* if we can't get dynamic info about the size, use static */
> !       if (*linep <= 0 || *colp <= 0)
> !           if (lines > 0 && columns > 0) {
> !               *linep = (int) lines;
> !               *colp = (int) columns;
>             }
> 
>         /* the ultimate fallback, assume fixed 24x80 size */
> --- 165,175 ----
>   #endif /* HAVE_SIZECHANGE */
> 
>         /* if we can't get dynamic info about the size, use static */
> !       if (*linep <= 0 ) {
> !           *linep = (int) lines;
> !           }
> !       if (*colp <= 0) {
> !           *colp = (int) columns;
>             }
> 
>         /* the ultimate fallback, assume fixed 24x80 size */
> 
> Diff finished at Sun Nov 19 01:14:01
> 
> Required action: Patch lib_setup.c or change the ncurses man page.
> 
> 3. When compiling a program with ncurses in cygwin it needs the
>    libncurses_dll library. The problem is that when neither NCURSES_DLL
>    nor NCURSES_STATIC are defined, the DLL version is selected.
> Solution:
>    Define either NCURSES_DLL or NCURSES_STATIC.
> Required action: Add this information to the README and the ncurses man
>    page (the cygwin version).
> 
> Ehud.
> 
> --
>  @@@@@@ @@@ @@@@@@ @    @   Ehud Karni  Simon & Wiesel  Insurance agency
>      @    @      @  @@  @   Tel: +972-3-6212-757    Fax: +972-3-6292-544
>      @    @ @    @ @  @@    (USA)  Fax  and  voice  mail:  1-815-5509341
>      @    @ @    @ @    @        Better     Safe     Than     Sorry
>  http://www.simonwiesel.co.il    mailto:ehud@unix.simonwiesel.co.il

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]