How to avoid control-c killing the open program?
How to avoid control-c killing the open program?
Dear All,
When I am running a program under Wine and I press Control-C, the running program is killed. However, this behavior is not always the desired one. In truth, imagine that the program is doing some calculations that you want to interrupt; if one presses Control-C, the program is killed, but all one wanted was to interrupt the calculations and NOT killing the program. Is there some workaround?
Thanks in advance,
Paul
When I am running a program under Wine and I press Control-C, the running program is killed. However, this behavior is not always the desired one. In truth, imagine that the program is doing some calculations that you want to interrupt; if one presses Control-C, the program is killed, but all one wanted was to interrupt the calculations and NOT killing the program. Is there some workaround?
Thanks in advance,
Paul
How to avoid control-c killing the open program?
On Thu, Jul 23, 2009 at 2:38 PM, phhs80<[email protected]> wrote:
calculation, I don't see what wine could do... it doesn't (and
shouldn't) have intimate knowledge of every application...
Now, if you just want to suspend the program, you can use your
terminal suspend feature (Ctrl-Z generally) to suspend the whole
process
Frédéric
Well, if the program itself doesn't provide a way to cancel aDear All,
When I am running a program under Wine and I press Control-C, the running program is killed. However, this behavior is not always the desired one. In truth, imagine that the program is doing some calculations that you want to interrupt; if one presses Control-C, the program is killed, but all one wanted was to interrupt the calculations and NOT killing the program. Is there some workaround?
Thanks in advance,
Paul
calculation, I don't see what wine could do... it doesn't (and
shouldn't) have intimate knowledge of every application...
Now, if you just want to suspend the program, you can use your
terminal suspend feature (Ctrl-Z generally) to suspend the whole
process
Frédéric
How to avoid control-c killing the open program?
On Thu, 2009-07-23 at 07:38 -0500, phhs80 wrote:
but it must be written to do that. The default action is to terminate
the process.
What does your program do when its run under Windows and you type
Control-C?
Martin
A Linux/UNIX program can catch Control-C and take any action it likes,Dear All,
When I am running a program under Wine and I press Control-C, the
running program is killed. However, this behavior is not always the
desired one.
but it must be written to do that. The default action is to terminate
the process.
What does your program do when its run under Windows and you type
Control-C?
Martin
Re: How to avoid control-c killing the open program?
Thanks to both answers.Martin Gregorie wrote:On Thu, 2009-07-23 at 07:38 -0500, phhs80 wrote:A Linux/UNIX program can catch Control-C and take any action it likes,Dear All,
When I am running a program under Wine and I press Control-C, the
running program is killed. However, this behavior is not always the
desired one.
but it must be written to do that. The default action is to terminate
the process.
What does your program do when its run under Windows and you type
Control-C?
Martin
On Windows, when I press Control-C the calculations of the program are interrupted, but the program is not killed. That is, the key sequence to interrupt calculations is Control-C. I am talking about a program that runs in a console.
Paul
How to avoid control-c killing the open program?
On Thu, 2009-07-23 at 08:35 -0500, phhs80 wrote:
doesn't catch, and which defaults to terminating the program.
In Windows Control-C defaults to causing a type 23H DOS interrupt - at
least that's what my ancient Borland C 4.x manual says. The default
handler for a 23H interrupt returns zero (stop the program) but the
program can replace the ctrlbrk handler with one that does something
useful to it and then returns non-zero (let the program continue). As
this involves grabbing a hardware interrupt vector I would not be
surprised if Wine doesn't handle it properly.
This mechanism may well be different for the NT-based versions of
Windows so if you haven't tried doing so, what difference does it make
if you set Wine to emulate Win98?
That's as far as my knowledge extends. If setting Wine to Win98 mode
doesn't help, it might be a question for the devs.
Martin
In POSIX Control-C is assigned to SIGINT, which your program obviouslyOn Windows, when I press Control-C the calculations of the program are
interrupted, but the program is not killed. That is, the key sequence
to interrupt calculations is Control-C. I am talking about a program
that runs in a console.
doesn't catch, and which defaults to terminating the program.
In Windows Control-C defaults to causing a type 23H DOS interrupt - at
least that's what my ancient Borland C 4.x manual says. The default
handler for a 23H interrupt returns zero (stop the program) but the
program can replace the ctrlbrk handler with one that does something
useful to it and then returns non-zero (let the program continue). As
this involves grabbing a hardware interrupt vector I would not be
surprised if Wine doesn't handle it properly.
This mechanism may well be different for the NT-based versions of
Windows so if you haven't tried doing so, what difference does it make
if you set Wine to emulate Win98?
That's as far as my knowledge extends. If setting Wine to Win98 mode
doesn't help, it might be a question for the devs.
Martin
How to avoid control-c killing the open program?
On Thu, Jul 23, 2009 at 8:35 AM, phhs80<[email protected]> wrote:
console process. I'm not sure if there's a workaround or not. File a
bug (search for an open one first).
--
-Austin
It should work fine for a gui app. For console apps, it cancels theMartin Gregorie wrote:Thanks to both answers.On Thu, 2009-07-23 at 07:38 -0500, phhs80 wrote:
A Linux/UNIX program can catch Control-C and take any action it likes,Dear All,
When I am running a program under Wine and I press Control-C, the
running program is killed. However, this behavior is not always the
desired one.
but it must be written to do that. The default action is to terminate
the process.
What does your program do when its run under Windows and you type
Control-C?
Martin
On Windows, when I press Control-C the calculations of the program are interrupted, but the program is not killed. That is, the key sequence to interrupt calculations is Control-C. I am talking about a program that runs in a console.
console process. I'm not sure if there's a workaround or not. File a
bug (search for an open one first).
--
-Austin
Re: How to avoid control-c killing the open program?
Thanks, Martin, for your reply. I have tried with Win98 emulation, but no progress.Martin Gregorie wrote: This mechanism may well be different for the NT-based versions of
Windows so if you haven't tried doing so, what difference does it make
if you set Wine to emulate Win98?
Paul
Re: How to avoid control-c killing the open program?
Thanks, Austin, for your suggestion. I have just filed the following bug:austin987 wrote: It should work fine for a gui app. For console apps, it cancels the
console process. I'm not sure if there's a workaround or not. File a
bug (search for an open one first).
http://bugs.winehq.org/show_bug.cgi?id=19437
Paul