From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11146 invoked by alias); 26 Jul 2013 12:08:08 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 11119 invoked by uid 89); 26 Jul 2013 12:08:07 -0000 X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mailout3.w1.samsung.com) (210.118.77.13) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 26 Jul 2013 12:08:05 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MQJ00J2NLP05480@mailout3.w1.samsung.com> for cygwin@cygwin.com; Fri, 26 Jul 2013 13:07:56 +0100 (BST) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 02.06.13793.C9662F15; Fri, 26 Jul 2013 13:07:56 +0100 (BST) Received: from fedinw7x64 ([106.109.9.113]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MQJ001VILP8VX40@eusync3.samsung.com>; Fri, 26 Jul 2013 13:07:56 +0100 (BST) From: Pavel Fedin To: 'Andy Koppe' Cc: cygwin@cygwin.com References: <51F1A863.8060403@etr-usa.com> <51F1AF90.3080409@cygwin.com> <51F1F7B4.4060202@etr-usa.com> In-reply-to: Subject: RE: BLODA extension: console interoperability Date: Fri, 26 Jul 2013 14:59:00 -0000 Message-id: <003601ce89f8$c3845f10$4a8d1d30$%fedin@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-SW-Source: 2013-07/txt/msg00580.txt.bz2 Hello! > I don't think that's fair, since such apps were designed for the > Windows console, without being aware of Cygwin's pipe-based ptys. And > unfortunately that list would be very long anyway: basically anything > interactive that hasn't been explicitly adapted to Cygwin ptys Let me also drop my 5 cents into this... We should be very careful about this. At least there is one case where dif= ference between Cygwin console and real Windows console plays a key role: n= curses. Normal Windows console is very basic and does not understand 90% of= control sequences. As a result, ncurses has been extended with 'terminal d= rivers', which redirect certain control functions to OS (Windows in our cas= e) API calls. Which, of course, work only with real Windows console. So, it's crucial to be able to detect whether we are running on Windows co= nsole or not. Here i have patched version of ncurses which uses GetConsoleM= ode(GetStdHandle(STD_OUTPUT_HANDLE), &mode) operation in order to detect th= is. This function returns error on non-console handles. This makes ncurses = working from within MSYS console. Previously an attempt to run ncurses app = simply trashed my console window with ESC sequences. Original ncurses relie= s on $TERM variable being empty, which works well with 'naked' cmd.exe, bu= t fails miserably with MSYS environment because MSYS sets $TERM to 'cygwin'= , while still operating inside Windows console which does not really unders= tand most of ESC sequences. With this fix applications can correctly determine whether they are runnin= g in Cygwin's shell and even over ssh connection, and correctly render in a= ll these cases. P.S. There is still a problem with input in these applications if run from= non-native console, but i think it's another story. I didn't look at it be= cause of lack of time and motivation. The goal was to cross-compile an ncur= ses app for Windows here at work, and the goal was reached. P.P.S. The patch is lying around and waiting to be submitted. I know, not = here, but likely to ncurses ML directly. However looks like FSF guys are no= t very keen on people committing to them, and they perhaps worry about lega= l-mumbo-jumbo much more than about programming and real openess. My two pat= ches sent to different lists (make and gnulib) were simply ignored. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple