[PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

Takashi Yano takashi.yano@nifty.ne.jp
Sat Aug 29 21:13:17 GMT 2020


On Sun, 30 Aug 2020 05:25:06 +0900
Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> wrote:
> On Sat, 29 Aug 2020 22:14:20 +0900
> Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> wrote:
> > On Sat, 29 Aug 2020 20:12:28 +0900
> > Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> wrote:
> > > Hi Corinna,
> > > 
> > > On Sat, 29 Aug 2020 04:25:54 +0900
> > > Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> wrote:
> > > > Hi Corinna,
> > > >
> > > > On Fri, 28 Aug 2020 15:45:03 +0200
> > > > Corinna Vinschen wrote:
> > > > > Hi Takashi,
> > > > > 
> > > > > On Aug 26 21:00, Takashi Yano via Cygwin-patches wrote:
> > > > > > Pseudo console generates escape sequences on execution of non-cygwin
> > > > > > apps.  If the terminal does not support escape sequence, output will
> > > > > > be garbled. This patch prevents garbled output in dumb terminal by
> > > > > > disabling pseudo console.
> > > [...]
> > > > > 
> > > > > Would you mind to encapsulate the TERM checks into a fhandler_pty_slave
> > > > > method so the TERM specific stuff is done in the fhandler code, not
> > > > > in spawn.cc?
> > > > 
> > > > Thansk for the suggestion. I will submit v2 patch.
> > > 
> > > What do you think of v3 patch attached? With this patch,
> > > terminal capability is checked by looking into terminfo
> > > database rather than just checking terminal name. This
> > > solution is more essential for the issue to be solved,
> > > I think.
> > > 
> > > One downside of this solution, I noticed, is that tmux
> > > sets TERM to "screen", which does not have CSI6n, by
> > > default. As a result, pseudo console is disbled in tmux
> > > by default. Setting TERM, such as screen.xterm-256color,
> > > will solve the issue.
> > 
> > Attached is the v4 patch. Small bug was fixed.
> 
> Bug fixed again. v5 patch attached.

v6: Refactor the code a little.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v6-0001-Cygwin-pty-Disable-pseudo-console-if-TERM-does-no.patch
Type: application/octet-stream
Size: 7458 bytes
Desc: not available
URL: <https://cygwin.com/pipermail/cygwin-patches/attachments/20200830/c365085d/attachment.obj>


More information about the Cygwin-patches mailing list