X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:content-transfer-encoding; q=dns; s=default; b=L+j2fLc2IfRpyIegm97nz0xuom34Xl63o0mShnZfclf WrG42yWc0+385rL1HUxNou9Fg0h8DGCKg7cHpx1j7plIFjwcMUQ0efezayfzG4x1 2RPtDwk6LBzRXNsHAjtECt3tn75LPa8Tt5AEmAhT1D+5aSFFLBEG+Z9Iohk2jLOE = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:content-transfer-encoding; s=default; bh=mMBq9tyuDULhKTxQjTT7++vdEyY=; b=RJqrkBEa568wVntFp 0SMfWomzn8URs8/tWixFAZsLRK0vyWu3JBDK9XWv7RZo6AWfyF4oBmOIlKw5nlup sri8zdRhjz/CRycjyFrhbv8oAt1oLwjAcZTs7oNA1p+7kHUy+eDGkvrjS7l2gkKp 2PQMPb91/V/p+sSYG4Yd/evyA0= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 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 DOT c147adf68d9069d354b294c3 AT nifty DOT ne DOT jp> In-Reply-To: <20200209084312.c147adf68d9069d354b294c3@nifty.ne.jp> From: Koichi Murase Date: Sun, 9 Feb 2020 11:20:18 +0800 Message-ID: Subject: Re: Question on pseudo console and legacy console To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 0193LEi5017908 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年2月9日(日) 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