delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/11/01/04:34:15

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D57B73857C65
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1635755652;
bh=5FApwghiLP7/KpxH0uQ5ETQ4SzhjXw3rTuKNCk64Wx4=;
h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=ebpnGl3a+4ICtyZA2pN/k/4M2EXxfUu+q/9noT6kQ5eR4LoybX5IYGrLUsE3YmCFg
KBiK4aw6mEpwLblLYdxNH6PmvAlxwe0baprQ/G1OjjhwFlPRV8NRIgZ+V+Fsj8So6y
gxEbWEnYmt0KtoFL0PUBjDogfaH/p7RhDuiCviGE=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E598E3858422
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=vLLHjTkp/1SUMOqQPTvOtmusIV7Bqm8q8lXpdOjtwKU=;
b=e6u9BOb+i9CpkOdbw+0lF44N47nlrJSFw7pP5dTu4ULkDDQjZmpM83il57D+noCrr3
g3moNa1k9AAG/EW14ZCsT3RaotxI95cRojq53pvSM/hKtVlcUhVvYuJjJ153bvmuYdWw
lisq4fsguDYVgDogCr8GpFWOaVNXs1SSDZJX5g7SX8AYSXpZT5QEwI3KG8LKc9MN1H2x
eMnJ6OhQ0+/KouMcDf1oG0iWDZLrebPhrdAcerDFoIF9WLRtlYqlusa4W/hRw8WwKwix
LwFDMxhDeEwJFVo4ej4GD72ECQCN07BW8PSF2Vv74dM298xbAfxh9VQxzCMRNCPh2rWL
uYzA==
X-Gm-Message-State: AOAM5314iawfxf0PpaU56EWj1OMHzwDIp0cfOUcT7fS9e1XSPr21Vep+
FbZGUv5MfBBa5SSUkjdWqXgLKSd1Y2BGsbfEsz+1QZB3/98=
X-Google-Smtp-Source: ABdhPJyzuKjAYUvum64EeMh97z8KYxcsfaks+EZXpUrgV3ccuSnJ24hQx7t4pvMo2rsa42Nkzugf+nHpgsgflnUOhgk=
X-Received: by 2002:a17:906:5804:: with SMTP id
m4mr34814911ejq.295.1635755617864;
Mon, 01 Nov 2021 01:33:37 -0700 (PDT)
MIME-Version: 1.0
Date: Mon, 1 Nov 2021 17:33:02 +0900
Message-ID: <CANoQjJvm5NgztRQo1y-wn1_kGO-j6JKmGsqUkOm1yaNBb7qQvQ@mail.gmail.com>
Subject: Ctrl+C is sometimes ignored on Windows Terminal
To: cygwin AT cygwin DOT com
X-Spam-Status: No, score=2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM,
KAM_SOMETLD_ARE_BAD_TLD, PDS_OTHER_BAD_TLD, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,
SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Naoto Aoki via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Naoto Aoki <naoto DOT november AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

--0000000000008bb3be05cfb6083a
Content-Type: text/plain; charset="UTF-8"

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

--0000000000008bb3be05cfb6083a
Content-Type: text/plain; charset="US-ASCII"; name="getkey.cpp"
Content-Disposition: attachment; filename="getkey.cpp"
Content-Transfer-Encoding: base64
Content-ID: <f_kvgeitpy1>
X-Attachment-Id: f_kvgeitpy1

Ly8gb3JpZ2luYWw6IGh0dHBzOi8vYmxvZy5nb28ubmUuanAvbG0zMjQvZS8xNjYyOWE4YWFkYWEw
ZGU3N2ZjMDU2MTEzOTBjZjE1YgovLyBtb2RpZmllZCBieSBhb250IDIwMjEvMTAvMTUKCiNpbmNs
dWRlIDxzdGRpby5oPgojaW5jbHVkZSA8c3RkbGliLmg+CiNpbmNsdWRlIDx0ZXJtaW9zLmg+CiNp
bmNsdWRlIDx1bmlzdGQuaD4KI2luY2x1ZGUgPHNpZ25hbC5oPgojaW5jbHVkZSA8ZmNudGwuaD4K
CmludCBnZXRrZXkodm9pZCkKewogICAgc3RydWN0IHRlcm1pb3Mgb2xkdCwgbmV3dDsKICAgIGlu
dCBjaDAsY2gxLGNoMixjaDMsY2g0OwogICAga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KTsKICAgICAgICAgICAgY2g0ID0gZ2V0Y2hhcigpOwogICAgICAgICAgICByZXQgPSAoY2gx
PDwyNCkgfCAoY2gyPDwxNikgfCAoY2gzPDw4KSB8IGNoNDsKICAgICAgICB9IGVsc2UgaWYoKGNo
Mj09MHgzMyl8fChjaDI9PTB4MzUpfHwoY2gyPT0weDM2KSkgewogICAgICAgICAgICBjaDMgPSBn
ZXRjaGFyKCk7CiAgICAgICAgICAgIHJldCA9IChjaDA8PDI0KSB8IChjaDE8PDE2KSB8IChjaDI8
PDgpIHwgY2gzOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldCA9IChjaDA8PDE2KSB8
IChjaDE8PDgpIHwgY2gyOwogICAgICAgIH0KICAgIH0gZWxzZSBpZihjaDAgIT0gRU9GKSB7CiAg
ICAgICAgcmV0ID0gY2gwOwogICAgfSBlbHNlIHsKICAgICAgICByZXQgPSAwOwogICAgfQoKICAg
IGlmKHRjc2V0YXR0cihTVERJTl9GSUxFTk8sIFRDU0FOT1csICZvbGR0KT09LTEpIHsKICAgICAg
ICBmcHJpbnRmKHN0ZGVyciwiZXJyb3IgdGNzZXRhdHRyXG4iKTsKICAgICAgICBleGl0KEVYSVRf
RkFJTFVSRSk7CiAgICB9CgogICAgcmV0dXJuIHJldDsKfQoKaW50IG1haW4oaW50IGFyZ2MsY2hh
ciAqYXJndltdKQp7CiAgICBpbnQga2V5OwoKICAgIHdoaWxlICgxKSB7CiAgICAgICAga2V5ID0g
Z2V0a2V5KCk7CiAgICAgICAgCiAgICAgICAgaWYgKGtleSE9MCkgewogICAgICAgICAgICBwcmlu
dGYoImtleSBjb2RlIDB4JXhcbiIsa2V5KTsKICAgICAgICB9ZWxzZXsKICAgICAgICAgICAgOwog
ICAgICAgICAgICB1c2xlZXAoMTAwMCk7CiAgICAgICAgfQogICAgICAgIGlmKGtleT09MHg3MSAv
KiBxICovICkgewogICAgICAgICAgICBicmVhazsKICAgICAgICB9CgogICAgfQoKICAgIHJldHVy
biAwOwp9Cgo=
--0000000000008bb3be05cfb6083a
Content-Type: text/plain; charset="US-ASCII"; name="rltest.cpp"
Content-Disposition: attachment; filename="rltest.cpp"
Content-Transfer-Encoding: base64
Content-ID: <f_kvgeitq32>
X-Attachment-Id: f_kvgeitq32

I2luY2x1ZGUgPHNldGptcC5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHNpZ25hbC5o
PgojaW5jbHVkZSA8cmVhZGxpbmUvcmVhZGxpbmUuaD4KCnNpZ2ptcF9idWYgY3RybGNfYnVmOwoK
dm9pZCBoYW5kbGVfc2lnbmFscyhpbnQgc2lnbm8pIHsKICBpZiAoc2lnbm8gPT0gU0lHSU5UKSB7
CiAgICBzaWdsb25nam1wKGN0cmxjX2J1ZiwgMSk7CiAgfQp9CgppbnQgbWFpbihpbnQgYXJnYywg
Y2hhciAqKmFyZ3YpCnsKICBjaGFyICogaW5wdXQ7CgogIGlmIChzaWduYWwoU0lHSU5ULCBoYW5k
bGVfc2lnbmFscykgPT0gU0lHX0VSUikgewogICAgZnByaW50ZihzdGRlcnIsICJpbnN0YWxsaW5n
IHNpZ25hbCBoYW5kbGVyIGZhaWxlZFxuIik7CiAgfQoKICAgIGNoYXIgYnVmWzEyOF07CiAgd2hp
bGUgKDEpIAogIHsKICAgIHdoaWxlICggc2lnc2V0am1wKCBjdHJsY19idWYsIDEgKSAhPSAwICkg
ewogICAgICBmcHJpbnRmKHN0ZGVyciwgIkN0cmwrQ1xuIik7CiAgICB9CgogICAgaW5wdXQgPSBy
ZWFkbGluZSgiPiAiKTsKICAgIGlmICghaW5wdXQpCiAgICAgIGJyZWFrOwoKICB9ICAKICByZXR1
cm4gMDsKfQ==
--0000000000008bb3be05cfb6083a
Content-Type: text/plain; charset="UTF-8"; name="EchoCon.cpp"
Content-Disposition: attachment; filename="EchoCon.cpp"
Content-Transfer-Encoding: base64
Content-ID: <f_kvgemex92>
X-Attachment-Id: f_kvgemex92

Ly8gRWNob0Nvbi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0ZW5lciwgMCwgaFBpcGVJbikpIH07CgogICAgICAgICAgICAvLyBJbml0aWFs
aXplIHRoZSBuZWNlc3Nhcnkgc3RhcnR1cCBpbmZvIHN0cnVjdCAgICAgICAgCiAgICAgICAgICAg
IFNUQVJUVVBJTkZPRVggc3RhcnR1cEluZm97fTsKICAgICAgICAgICAgaWYgKFNfT0sgPT0gSW5p
dGlhbGl6ZVN0YXJ0dXBJbmZvQXR0YWNoZWRUb1BzZXVkb0NvbnNvbGUoJnN0YXJ0dXBJbmZvLCBo
UEMpKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAvLyBMYXVuY2ggcGluZyB0byBlbWl0
IHNvbWUgdGV4dCBiYWNrIHZpYSB0aGUgcGlwZQogICAgICAgICAgICAgICAgUFJPQ0VTU19JTkZP
Uk1BVElPTiBwaUNsaWVudHt9OwogICAgICAgICAgICAgICAgaHIgPSBDcmVhdGVQcm9jZXNzKAog
ICAgICAgICAgICAgICAgICAgIE5VTEwsICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm8g
bW9kdWxlIG5hbWUgLSB1c2UgQ29tbWFuZCBMaW5lCiAgICAgICAgICAgICAgICAgICAgc3pDb21t
YW5kLCAgICAgICAgICAgICAgICAgICAgICAvLyBDb21tYW5kIExpbmUKICAgICAgICAgICAgICAg
ICAgICBOVUxMLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFByb2Nlc3MgaGFuZGxlIG5v
dCBpbmhlcml0YWJsZQogICAgICAgICAgICAgICAgICAgIE5VTEwsICAgICAgICAgICAgICAgICAg
ICAgICAgICAgLy8gVGhyZWFkIGhhbmRsZSBub3QgaW5oZXJpdGFibGUKICAgICAgICAgICAgICAg
ICAgICBGQUxTRSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluaGVyaXQgaGFuZGxlcwog
ICAgICAgICAgICAgICAgICAgIEVYVEVOREVEX1NUQVJUVVBJTkZPX1BSRVNFTlQsICAgLy8gQ3Jl
YXRpb24gZmxhZ3MKICAgICAgICAgICAgICAgICAgICBOVUxMLCAgICAgICAgICAgICAgICAgICAg
ICAgICAgIC8vIFVzZSBwYXJlbnQncyBlbnZpcm9ubWVudCBibG9jawogICAgICAgICAgICAgICAg
ICAgIE5VTEwsICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVXNlIHBhcmVudCdzIHN0YXJ0
aW5nIGRpcmVjdG9yeSAKICAgICAgICAgICAgICAgICAgICAmc3RhcnR1cEluZm8uU3RhcnR1cElu
Zm8sICAgICAgIC8vIFBvaW50ZXIgdG8gU1RBUlRVUElORk8KICAgICAgICAgICAgICAgICAgICAm
cGlDbGllbnQpICAgICAgICAgICAgICAgICAgICAgIC8vIFBvaW50ZXIgdG8gUFJPQ0VTU19JTkZP
Uk1BVElPTgogICAgICAgICAgICAgICAgICAgID8gU19PSwogICAgICAgICAgICAgICAgICAgIDog
R2V0TGFzdEVycm9yKCk7CgogICAgICAgICAgICAgICAgY2hhciBpbnB1dF9rZXk7CiAgICAgICAg
ICAgICAgICBEV09SRCBudW1fZXZlbnRzOwogICAgICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsK
ICAgICAgICAgICAgICAgICAgICBib29sIHJldDsKICAgICAgICAgICAgICAgICAgICByZXQgPSBS
ZWFkRmlsZShoaW4sICZpbnB1dF9rZXksIDEsICZudW1fZXZlbnRzLCBOVUxMKTsKICAgICAgICAg
ICAgICAgICAgICBpZiAocmV0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoc3Rk
ZXJyLCAiaW5wdXQ6IDB4JXhcbiIsIGlucHV0X2tleSk7CiAgICAgICAgICAgICAgICAgICAgICAg
IFdyaXRlRmlsZShoUGlwZU91dCwgJmlucHV0X2tleSwgMSwgJm51bV9ldmVudHMsIE5VTEwpOwog
ICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg
IH07CgoKICAgICAgICAgICAgICAgIGlmIChTX09LID09IGhyKQogICAgICAgICAgICAgICAgewog
ICAgICAgICAgICAgICAgICAgIC8vIFdhaXQgdXAgdG8gMTBzIGZvciBwaW5nIHByb2Nlc3MgdG8g
Y29tcGxldGUKICAgICAgICAgICAgICAgICAgICBXYWl0Rm9yU2luZ2xlT2JqZWN0KHBpQ2xpZW50
LmhUaHJlYWQsIDEwICogMTAwMCk7CgogICAgICAgICAgICAgICAgICAgIC8vIEFsbG93IGxpc3Rl
bmluZyB0aHJlYWQgdG8gY2F0Y2gtdXAgd2l0aCBmaW5hbCBvdXRwdXQhCiAgICAgICAgICAgICAg
ICAgICAgU2xlZXAoNTAwKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAvLyAt
LS0gQ0xPU0VET1dOIC0tLQoKICAgICAgICAgICAgICAgIC8vIE5vdyBzYWZlIHRvIGNsZWFuLXVw
IGNsaWVudCBhcHAncyBwcm9jZXNzLWluZm8gJiB0aHJlYWQKICAgICAgICAgICAgICAgIENsb3Nl
SGFuZGxlKHBpQ2xpZW50LmhUaHJlYWQpOwogICAgICAgICAgICAgICAgQ2xvc2VIYW5kbGUocGlD
bGllbnQuaFByb2Nlc3MpOwoKICAgICAgICAgICAgICAgIC8vIENsZWFudXAgYXR0cmlidXRlIGxp
c3QKICAgICAgICAgICAgICAgIERlbGV0ZVByb2NUaHJlYWRBdHRyaWJ1dGVMaXN0KHN0YXJ0dXBJ
bmZvLmxwQXR0cmlidXRlTGlzdCk7CiAgICAgICAgICAgICAgICBmcmVlKHN0YXJ0dXBJbmZvLmxw
QXR0cmlidXRlTGlzdCk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vIENsb3NlIENvblBU
WSAtIHRoaXMgd2lsbCB0ZXJtaW5hdGUgY2xpZW50IHByb2Nlc3MgaWYgcnVubmluZwogICAgICAg
ICAgICBDbG9zZVBzZXVkb0NvbnNvbGUoaFBDKTsKCiAgICAgICAgICAgIC8vIENsZWFuLXVwIHRo
ZSBwaXBlcwogICAgICAgICAgICBp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0cmlidXRlTGlzdCwg
MSwgMCwgJmF0dHJMaXN0U2l6ZSkpCiAgICAgICAgewogICAgICAgICAgICAvLyBTZXQgUHNldWRv
IENvbnNvbGUgYXR0cmlidXRlCiAgICAgICAgICAgIGhyID0gVXBkYXRlUHJvY1RocmVhZEF0dHJp
YnV0ZSgKICAgICAgICAgICAgICAgIHBTdGFydHVwSW5mby0+bHBBdHRyaWJ1dGVMaXN0LAogICAg
ICAgICAgICAgICAgMCwKICAgICAgICAgICAgICAgIFBST0NfVEhSRUFEX0FUVFJJQlVURV9QU0VV
RE9DT05TT0xFLAogICAgICAgICAgICAgICAgaFBDLAogICAgICAgICAgICAgICAgc2l6ZW9mKEhQ
Q09OKSwKICAgICAgICAgICAgICAgIE5VTEwsCiAgICAgICAgICAgICAgICBOVUxMKQogICAgICAg
ICAgICAgICAgPyBTX09LCiAgICAgICAgICAgICAgICA6IEhSRVNVTFRfRlJPTV9XSU4zMihHZXRM
YXN0RXJyb3IoKSk7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAg
IGhyID0gSFJFU1VMVF9GUk9NX1dJTjMyKEdldExhc3RFcnJvcigpKTsKICAgICAgICB9CiAgICB9
CiAgICByZXR1cm4gaHI7Cn0KCnZvaWQgX19jZGVjbCBQaXBlTGlzdGVuZXIoTFBWT0lEIHBpcGUp
CnsKICAgIEhBTkRMRSBoUGlwZXsgcGlwZSB9OwogICAgSEFORExFIGhDb25zb2xleyBHZXRTdGRI
YW5kbGUoU1REX09VVFBVVF9IQU5ETEUpIH07CgogICAgY29uc3QgRFdPUkQgQlVGRl9TSVpFeyA1
MTIgfTsKICAgIGNoYXIgc3pCdWZmZXJbQlVGRl9TSVpFXXt9OwoKICAgIERXT1JEIGR3Qnl0ZXNX
cml0dGVue307CiAgICBEV09SRCBkd0J5dGVzUmVhZHt9OwogICAgQk9PTCBmUmVhZHsgRkFMU0Ug
fTsKICAgIGRvCiAgICB7CiAgICAgICAgLy8gUmVhZCBmcm9tIHRoZSBwaXBlCiAgICAgICAgZlJl
YWQgPSBSZWFkRmlsZShoUGlwZSwgc3pCdWZmZXIsIEJVRkZfU0laRSwgJmR3Qnl0ZXNSZWFkLCBO
VUxMKTsKCiAgICAgICAgLy8gV3JpdGUgcmVjZWl2ZWQgdGV4dCB0byB0aGUgQ29uc29sZQogICAg
ICAgIC8vIE5vdGU6IFdyaXRlIHRvIHRoZSBDb25zb2xlIHVzaW5nIFdyaXRlRmlsZShoQ29uc29s
ZS4uLiksIG5vdCBwcmludGYoKS9wdXRzKCkgdG8KICAgICAgICAvLyBwcmV2ZW50IHBhcnRpYWxs
eS1yZWFkIFZUIHNlcXVlbmNlcyBmcm9tIGNvcnJ1cHRpbmcgb3V0cHV0CiAgICAgICAgV3JpdGVG
aWxlKGhDb25zb2xlLCBzekJ1ZmZlciwgZHdCeXRlc1JlYWQsICZkd0J5dGVzV3JpdHRlbiwgTlVM
TCk7CgogICAgfSB3aGlsZSAoZlJlYWQgJiYgZHdCeXRlc1JlYWQgPj0gMCk7Cn0=
--0000000000008bb3be05cfb6083a
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


-- 
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

--0000000000008bb3be05cfb6083a--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019