X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A43B3857C4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1635756666; bh=QhPzzpLRPM+Oq8N/+8v6AY3jaWZ6HloJtqQU9+Wsk1I=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=CSz/+U4pmfZg8JyW03un13sf0WpOhCUJHaRAuKgFn83t1kXJn0+H/HmKJVIKq4Sfa s8KBs76QepHyRn6WxMKPGVxvg71EtiF6K5wNY7zH/YgBBYh8NWGuMMQ6m1csh5/xcY LfVzCb+WY2n2+dJ5h87KWUvY34gV6XccoHHxgej4= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8EC7C385800B X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OR3BXDqRHN1rpwnJXcI/ffMQH7movn/xbPuRP7zQ1Dw=; b=MCbp3RmkcKgehqZeHRuHRam56mlL09doKKDd9LGAK3tt32Veo7iBE+IhiM4hLXIWOP TezZ2h6/4s48B+obGpFg+5F6pWd4MrVSuhYMA+4cRR63ifIa/JH9sqDVDmgWxYLbYHI7 KqzYzP/0qr+V4wU3DRz8xWTY6UdOtP7Kp4HPF6bCLLjSK4vhoqUqAKd1/vku0vSWdB1i uW1x+NWtMFEs3sM1C+Y4QcTseBU4LB5hIsM1yvsMVnR3Xt1iGFmtmyNmZRXkz0fEi/v1 TpMmk2qp8QDm3VN/6ayRrbDqgYDycDWQgyhm5YS+0hY5ckmX1A+nTWZHTRquwZoJF+fh nTDw== X-Gm-Message-State: AOAM530nE+OoXFbcMmAEY9DfuRkNHo4nk2LUhfbXFVBqtuLmfX4gcFcq FBdd8UWjZCCsbD7mVfNjXBG/9/AKKmFGI5Afrlg= X-Google-Smtp-Source: ABdhPJzdk8F7fLZD7lqTVrTKXVf7o5HOM8NtvJ/fpG8U8YAOlfR6098ekS5MUyNfpkYFcNt/4yRFtz5ydVYf3a18vo8= X-Received: by 2002:a05:6808:1a14:: with SMTP id bk20mr12975201oib.52.1635756622574; Mon, 01 Nov 2021 01:50:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 1 Nov 2021 01:50:07 -0700 Message-ID: Subject: Re: Ctrl+C is sometimes ignored on Windows Terminal To: Naoto Aoki X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Russell VT via Cygwin Reply-To: Russell VT Cc: cygwin Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" If you're running things from under Windows Terminal, rather than the Cygwin terminal, the behavior is likely going to be inconsistent or unpredictable (and things like interrupts may be handled at a lower level within the terminal, first, before passing to a higher level and received by Cygwin). I'd work on trying to reproduce this in any of the terminals provided by Cygwin... otherwise, chances are you might need to dig deeper in MSTerminal, or even WIndows, first. Regards, Russell VT On Mon, Nov 1, 2021 at 1:34 AM Naoto Aoki via Cygwin wrote: > Hi, > > When I'm using some programs such as bash and python from cygwin under > Windows Terminal, Ctrl+C is sometimes ignored. > https://github.com/microsoft/terminal > > Normally holding 'Ctrl' and pressing 'C' will make new line. > But, sometimes it does not and unholding 'Ctrl' makes new line under > Windows Terminal. > bash from msys2 does also reproduce this issue. > > I dug into this issue and found that this is related to > readline and Windows 10's pseudo console (ConPTY). > I made simple programs to reproduce this issue. > > - EchoCon.cpp > - modification of ConPty sample code provided by Microsoft. > This program execute bash on pseudo console. > to be compiled with MSVC. > - getkey.cpp > - simple program to check Ctrl+C is passed to Cygwin program. > to be compiled with Cygwin gcc. > - rltest.cpp > - simple program to check SIGINT handling. > This program reproduces the issue. > If you replace readline("> ") with gets(buf), > then the issue does not happen. > to be compiled with Cygwin gcc. > > - The machine and OS that it is running on > - OS: Windows 10 Pro 19043.1288 > - Windows Terminal: 1.11.2921.0 > > Regards, > Naoto Aoki > > -- > Problem reports: https://cygwin.com/problems.html > FAQ: https://cygwin.com/faq/ > Documentation: https://cygwin.com/docs.html > Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple > -- Russell M. Van Tassell -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple