From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65821 invoked by alias); 9 Feb 2020 03:20:37 -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 65724 invoked by uid 89); 9 Feb 2020 03:20:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=aimed, consoles X-HELO: mail-lj1-f174.google.com Received: from mail-lj1-f174.google.com (HELO mail-lj1-f174.google.com) (209.85.208.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Feb 2020 03:20:32 +0000 Received: by mail-lj1-f174.google.com with SMTP id q8so3318034ljj.11 for ; Sat, 08 Feb 2020 19:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=c53MPt8wfk+GlzyQxUPeBJoDUZorgQysL3kROu5N3FI=; b=sYD+evc2shmf4r/4ntWN90/qb3ugnke19Cddsr0fqLBSjnGmDPxu/QVcPS7LtxJs8n 4d1eXrTHF5/5m/ZYaH+G4fq/TnINv3UgMyjl9O1OdLUcg43kZ5bE5gYU+TZyn3n2LFTI fM/KoT8QJPYfGrC2UO1651uj55FrmEds4AovXDMGZrYAMo799HJ6s9eYt0wOIVPNCA6/ PBr2jzc9t6z/81ljCIm+X0YbuqLl283Nh84C4M9lsMaemNZ3Z8VS4G9CnKMzeO0T7+/j keeK1DcwofEo/7LT73uDCeFcyAKvOPKZhXaBHDs3i34G8AlfLkbx22m8FVgea+e2oLDk Sn/g== MIME-Version: 1.0 References: <20200209084312.c147adf68d9069d354b294c3@nifty.ne.jp> In-Reply-To: <20200209084312.c147adf68d9069d354b294c3@nifty.ne.jp> From: Koichi Murase Date: Sun, 09 Feb 2020 03:20:00 -0000 Message-ID: Subject: Re: Question on pseudo console and legacy console To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00073.txt.bz2 Thank you for the explanation. I think I'm going to by default add `disable_pcon' to the environment variable `CYGWIN' before calling `posix_openpt'. 2020=E5=B9=B42=E6=9C=889=E6=97=A5(=E6=97=A5) 7:43 Takashi Yano > Do you mean "without pseudo console support" by "legacy console mode"? Yes. > If so, pty should behave as before 3.1.0 if you set disable_pcon, I see. Actually I was particularly interested in whether the introduction of the pseudo console support is related to solving any existing problems before 3.1.0 or not. > except that char code conversion, from code page which you set, to > char code which is declared by locale, is still enabled. I haven't recognized this change. This is really nice! > With out pseudo console, for example: > 1) cmd.exe echos command twice. > 2) dir /p does not work in cmd.exe. > 3) Many of windows native console apps such as windows native gnuplot > does not work at all. OK, there are in fact functional differences between the pseudo console mode and the legacy console mode. So, is the purpose of the introduction of the pseudo console mode is not just to enhance the Cygwin console but to make Windows Command-Line applications work properly in all Cygwin terminals including terminal emulators as well as console? Now I understand the difficulties of the pseudo console modes. This is really challenging as Windows Console API and ANSI/VT terminal sequences are independent ecosystems and based on different models. I'm not sure if it is even possible to make it realize in a completely transparent way for both types (Windows and Cygwin) of applications. > > * If the console mode would not cause any differences when there > > is no visible console window, would it make sense to change > > Cygwin's behavior so that it switches to the pseudo console mode > > only when the console window is present (if it is not too > > difficult technically)? > > I am not sure what you mean "the console window is present", but I am sorry I did not put it clearly. By "the console window is present", I meant the case that a console will be allocated for the terminal emulator but the corresponding GUI console window will not be shown in the foreground. My suggestion was to choose/switch a mode for each PTY session but not for each program. Specifically I thought about completely disabling the pseudo console support with terminal emulators, and turning on it only for Cygwin consoles. But this is based on my assumption that the pseudo console mode is aimed to provide enhanced Cygwin consoles and does not affect the functional differences in terminal emulators. ---- Nevertheless, IMHO, the current implementation of the pseudo console mode is better to be turned off for terminal emulators by default and only turned on for Cygwin consoles. Of course, it can still optionally be turned on in terminal emulators when the user or the terminal emulator explicitly request that. The TTY/PTY mechanism should be transparent to the types of terminals, but the current implementation of PTY by the pseudo console mode requires a specific set of terminal capabilities and does not allow any extensions which is not in the pseudo console. This is not a good design as a basic system API. If this pseudo console mode is defaulted for Cygwin PTY, that means any terminal emulator cannot be implemented properly on Cygwin except the case that the terminal emulator is a perfect copy of the pseudo console. In fact there are already many reports caused by the behavior difference of the pseudo console from an expected one. I don't think this kind of troubles stops by just modifying the superficial behavior of the current implementation. We want to avoid supporting new features (Windows Command-Line applications) by breaking many existing applications which opens PTY. I think it is better to wait until we could find a way to make the PTY behavior transparent to the terminal types. ---- Thank you, Koichi -- 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