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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=bEYAJvGRKnZ4c72C 7PCP724qHVY5wBteNXdHLm3DM6CADRAqkMNY0PdndwugISZXFOFZ6xLVTa+UnZsa udDjVfk36ATyfY8Pua3czvtoX8pOmnCqKyxeNeJSoruaxXuIhx8M4w9haHJclzGX EJjnSjJ/aoaPCq3yahF0+8LYyBc= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=FhdZzMmlCyd3D3KD1N7N0T D9N5A=; b=YZBufvEFoS4e94mIMxol1ga0eh09Yuemv/Y2EOZyLepOXEVJS63uAU TNyuHWCbY5lcSYBMTJnu92igK235fR6GD6Nt0E0P8uUaZQETDAw6S4tuz9BENIQg gJpZNkWem8FRg1RG8zsD/Bj3bRxjl3/WeSckIlCt67VjFIQPqZsZw= 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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=multiline, differs, H*Ad:D*googlemail.com, interactive X-HELO: mail-wr1-f47.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=qUpPb1LUKWoZ3EJo1A1S48CTfPHukC81IIj3teIr5Z4=; b=mIIDIuLhsXrfasbALxQu7epZ5UjSEdjTxp+4w3s24vbtPju298Zuek+tKjaZUTz+LS GmjzhTeq/3rWQfVwtKK7mvqp0TuXBwM0U09Kvta0VCnIQrg+jZ25KjAUT04CbwRnDHF1 Rk93g4D9+ro+hkGtxUj0QAcaiAu4iMTyAxFDd/KFdHI5GbxBhUb+d8ma9XhtA+Gqc4iq rdG1rxK/UCiZzz5kHaIF/5wbbtxrgPyKg2KYUcFqxd11BcpmEr9ZBpknXdaMoIgr8X3P 2vvBDM0PweYPgJH+5pWm9wKz4xbflVnSURr9K/qQfuUHmb3ItE44SuvYVst0uqXgidMq D3Pw== Subject: Re: 3.1.x: Mangled input/output when calling non-cygwin programs To: cygwin AT cygwin DOT com References: <7e3d947e-b178-30a3-589f-b48e6003fbb3 AT googlemail DOT com> <20200202185909 DOT a3b3f8627438177e18171de3 AT nifty DOT ne DOT jp> From: m0viefreak Message-ID: <04b7abc1-3317-51c2-99e2-c8573458a5f1@googlemail.com> Date: Sun, 2 Feb 2020 13:18:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20200202185909.a3b3f8627438177e18171de3@nifty.ne.jp> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes On 02.02.2020 10:59, Takashi Yano wrote: > On Sat, 1 Feb 2020 19:00:04 +0100 > m0viefreak wrote: >> Since Cygwin 3.1's pseudo console support was introduced I've run into >> lots of issues with non-cygwin programs. > > Thanks for the report. > >> 1) Mangled output: See screenshot [1]. >> As you can see, at what it seems random places, the output is broken. >> The above can easily be reproduced using Apache Maven in any project, >> e.g. using a sample project created using [2]. >> >> 2) Terminal width: For some reason, non-native programs do not use the >> full width of the terminal (Mintty and TERM=xterm-256color). Can also >> be seen in [1] (blue highlight) and reproduced e.g. using Maven with >> a relatively small window. > > I looked into this problem, but Maven is something weird. > I don't think it uses termcap or terminfo, but it behaves > differently depending on TERM. > > If you run > env TERM=cygwin mvn > in mintty, problem 1) and 2) does not occur. Interesting, this solves the mangled output. But it somewhat contradicts that TERM should not matter (see below). >> 3) Typed characters while non-cygwin program is running are lost. >> Usually, when typing characters while a native program executes, >> which does *not* read from standard input, after the program exits, >> all these typed characters are put into the prompt. >> When executing a non-native program, such as, again, "mvn clean", >> which does not read from stdin, typed characters are completely lost. >> This is very frustrating, since I am often quicker at tying the >> next command, while the previous command is still doing something. > > I know the cause of this problem. Let me consider. That would be great to have the same experience as without pcon. >> 4) Importance of TERM: When connecting to my Cygwin installation using >> SSH using Putty, TERM=putty-256color is set. When executing non- >> native program from that session using that TERM, output is broken >> even worse than in 1), and also keybindings are broken. I need to >> force TERM=xterm-256color for those invocations. >> Shouldn't this be handled transparently and enforced automatically by >> the pcon code? > > Which keybinding is broken? In my environment, arrow keys and function > keys work as expected in cmd.exe and windows-native vim. HOME/END keys were broken if the native app brought up an interactive prompt. > My configuration of putty is: > Terminal > + Keybord > + The Function keys and keypad: Xterm R6 > > The PTY codes do not reffer to TERM environment, so cygwin1.dll itself > should not behave differently depending on TERM. It seems that the cygwin1.dll does not care about TERM, but if a non-native application *uses* TERM for whatever reason things start to break. If indeed 'cygwin' is the right terminfo to be used, should the PTY code then somehow set TERM=cygwin in the non-native process? But what if the none-native program doesn't even know the 'cygwin' terminfo? One more thing (maybe also related): When calling a non-native program that prints very sinle long line (e.g. just 'mvn' without args) that wraps around the terminal, and then copying that multi-line output from mintty, the result differs: - disable_pcon: A single line is copied - default: Multiple lines are copied (like in block selection mode) -- 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