On Mon Feb 17 19:22:08 2025 +0000, eric pouech wrote:
thanks for taking the time to update your patch unfortunately, it fails on wine regression test the attached patch should solve this [patch.ctrlc](/uploads/84ae84d1c5cf3d3dfc19904c673bc906/patch.ctrlc) also, any reason you changed the ctrl event for and automatic reset? actually, I was puzzled with the previous versions with a manual reset (my first guess would have been to implement it with an automatic reset) I tried things like '(dir /s \* || echo aaaaa) && dir *' (and halting the first dir command with ctrl-c) on native:
- does break the first dir command,
- executes the RHS of || (as the dir command failed because of the
ctrl-c),
- prints the 'aaaaa' string
- executes the RHS of && (as last command of LHS, eg echo, did succeed),
- outputs just the directory header (but nothing else) for the second dir
which fits better with a manual reset (it could be implemented in native with something else, like a global variable set in the event handler -requires atomic ops-)
Thank you for the patch. I will try to get that integrated sometime today. I'll be traveling for the next few days and will have limited ability during that time to address further concerns.
Automatic vs. manual reset were based on my thinking about whether the function WCMD_ctrlc_status would be called more than once per command iteration. If called only once then ownership of the status passes to the caller and thus automatic reset is cleaner. However, thinking further about this, it probably makes sense to switch back to manual reset, in case future callers (i.e. perhaps for different internal commands, etc.) might want to call it more than once per iteration. That, and the fact that there is a manual reset anyway before command launch in the loop toward the end of wmain suggests that a manual reset would be better, so I will switch back when I submit the changes containing your patch.