Skip to content
Tcl Source Code Artifact [4e59793eb8]
Login

Artifact [4e59793eb8]

Artifact 4e59793eb8befe610cee7238f6e9dc1583ba64af:

Ticket change [4e59793eb8] - New ticket [e66e44444023ee25|e66e444440] <i>Change Ctrl-C handling in Windows console</i>. by apnadkarni on 2015-03-19 02:33:21.
D 2015-03-19T02:33:21.352
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment Background:\sWindows\sallows\sCtrl-C,\sCtrl-Break\setc.\sto\sbe\strapped\sby\sthe\sapplication\svia\sthe\sSetConsoleCtrlHandler\scall.\sAlthough\sTcl\sitself\sdoes\snot\ssupport\sthis\sin\sthe\score,\sextensions\ssuch\sas\stwapi\sdo.\sHowever,\sa\sfeature/bug/quirk\sin\sthe\stclWinConsole.c:ReadConsoleBytes\sfunction\smakes\sthis\strapping\sineffective.\sAs\sdocumented\sin\sMSDN,\sa\sCtrl-C\sresults\sin\sthe\sWindows\sReadConsole\scall\sreturning\ssuccessfully\sbut\swith\s0\sbytes\sread.\sThis\sgets\sfunneled\sup\sthe\sTcl\schannel\ssystem\sas\sEOF\son\sstdin\sand\sconsequently\sthe\sREPL\sloop\sexits.\r\n\r\nThe\sproposed\schange\swould\sbe\sto\schange\sReadConsoleBytes\sto\sdetect\sthis\s(GetLastError()\sreturns\sERROR_OPERATION_ABORTED)\sand\ssimply\srepost\sthe\sReadConsole.\r\n\r\nThere\swill\sbe\sno\sobserved\schange\sin\sthe\sdefault\sbehaviour\sbecause\sthe\sdefault\sOS\shandler\s(run\sin\sa\sseparate\sthread)\swill\sstill\sexit\sthe\sprocess\son\sa\sCtrl-C.\sHowever,\sapplications\sthat\suse\sextensions\sto\strap\sCtrl-C\sby\sreplacing\sthe\sdefault\shandler\swill\swork\sas\sexpected.\r\n\r\nThe\sproposed\schange\sis\sin\sthe\sWindows-specific\scode\sand\swill\snot\saffect\sother\splatforms.\r\n\r\nReference:\shttp://stackoverflow.com/questions/27903208/tcl-and-ctrl-c-in-windows-console/27904696#27904696
J is_private 0
J login apnadkarni
J priority 5\sMedium
J resolution None
J severity Minor
J status Open
J submitter apnadkarni
J subsystem 25.\sChannel\sSystem
J title Change\sCtrl-C\shandling\sin\sWindows\sconsole
J type RFE
K e66e44444023ee253956979c54c905c6006f4540
U apnadkarni
Z 8cfe427fdeeadb223968d23bbe9372eb