From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75666 invoked by alias); 26 May 2016 15:46:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 75654 invoked by uid 89); 26 May 2016 15:46:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:cable.0, HX-HELO:eggs.gnu.org, Hx-spam-relays-external:208.118.235.92, H*RU:208.118.235.92 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 26 May 2016 15:46:15 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5xUA-0004T4-3t for gdb-patches@sourceware.org; Thu, 26 May 2016 11:46:13 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5xU9-0004Se-Vq; Thu, 26 May 2016 11:46:10 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2409 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b5xU8-0000Lp-7K; Thu, 26 May 2016 11:46:08 -0400 Date: Thu, 26 May 2016 15:46:00 -0000 Message-Id: <838tyw3jqw.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves CC: gdb-patches@sourceware.org In-reply-to: <3f622c77-762a-c86e-cafb-60f75a598d6c@redhat.com> (message from Pedro Alves on Thu, 26 May 2016 12:43:01 +0100) Subject: Re: [PATCH v2 24/25] Add new command to create extra console/mi UI channels Reply-to: Eli Zaretskii References: <1458573675-15478-1-git-send-email-palves@redhat.com> <1458573675-15478-25-git-send-email-palves@redhat.com> <83twjz6bex.fsf@gnu.org> <56F02689.2050503@redhat.com> <83r3f369io.fsf@gnu.org> <56F035F3.6060702@redhat.com> <3f622c77-762a-c86e-cafb-60f75a598d6c@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00455.txt.bz2 > Cc: gdb-patches@sourceware.org > From: Pedro Alves > Date: Thu, 26 May 2016 12:43:01 +0100 > > I've been thinking a bit on how to make this all work on Windows, > with Eclipse, and my current thinking is that instead of some hack to > embed a native console window inside the GUI, better would be to reuse > the same Eclipse terminal emulator widget, and coax gdb > to send the right terminal escape sequences for cursor movement > and character placement as a Unix gdb would. Sorry, I know nothing about this "Eclipse terminal emulator widget". In any case, this is Eclipse-specific, right? > So in the end, GDB would be running with input/output connected to a > named pipe, and we'd need to force gdb and ncurses to believe that > that is a terminal. I'm quite sure this would be a lot of work. > I'm aware that GNU ncurses, has a concept of "drivers", and it > has a driver for real windows consoles ("win32con") and that is > the default. AFAIK, the way to select the driver is to set > the TERM env var. To select a different driver? Yes, the default is only used if TERM is unset. > The problems will probably be around isatty checks in > readline and ncurses, as you suggested. > > There may also be #ifdef WIN32 bits in those libraries that > are #ifdef-ing out code that we'll need, assuming terminal == console, > though I haven't really checked. Right. > The isatty problem looks very much like the problem a native Windows/mingw > program has when run on a Cygwin terminal (and MSYS/MSYS2, which are > Cygwin forks), since Cygwin emulates pseudo terminals via named pipes. > See, e.g.,: > > http://www.spinics.net/lists/git/msg274348.html Cygwin also owns the libc it uses, so it's easy to work around the related problems. MinGW cannot do that easily. > BTW, while investigating this, I found that since some recent > update to Windows 10, Windows consoles now supports ansi/vt100 > escape sequences, finally: > > http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-%28v1511%29-Console-Host-Enhancements > > This further reinforces to me the idea of using ansi escapes on > Windows Eclipse/gdb too. Not sure how that is related, since the emulator is not a console for the program that runs on it.