bugOCaml Text Mode Kit - Bugs: bug #31539, Curses.get_size is broken on...

 
 

bug #31539: Curses.get_size is broken on Cygwin (regression)

Submitter:  Paul Pelzl <pelzlpj>
Submitted:  Wed 03 Nov 2010 07:19:32 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 03 Nov 2010 07:19:32 PM UTC, original submission:  

A Cygwin user reported an error which indicates a failure to retrieve the correct terminal size when running under an xterm.  An older version of the curses bindings works OK.

I believe this is the offending change:

 ML0d(get_size,int*int)
-BEG0 struct winsize ws;
+BEG0
+#ifndef WIN32
+  struct winsize ws;
   ioctl(0,TIOCGWINSZ,&ws);
   r_int_int(ws.ws_row,ws.ws_col);
+#else
+  COORD max;
+  HANDLE con;
+  con = GetStdHandle (STD_OUTPUT_HANDLE);
+  max = GetLargestConsoleWindowSize (con);
+  r_int_int (max.Y, max.X);
+#endif
 END

Probably the WIN32 macro is getting defined (maybe due to the OCamlMakefile?).  My understanding is that it is usually not appropriate to define WIN32 for Cygwin build environments.

Paul Pelzl <pelzlpj>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pelzlpj (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code