[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Signal handling?

From: Peter Brinkmann
Subject: Re: Signal handling?
Date: Thu, 8 Nov 2001 23:15:53 -0600
User-agent: Mutt/1.2.5i

On Thu, Nov 08, 2001 at 10:59:32PM -0600, John W. Eaton wrote:
> On 31-Oct-2001, Peter Brinkmann <address@hidden> wrote:
> | How can I change the way octave handles signals (keyboard interrupt in
> | particular)? 
> | 
> | Consider, for example, the following code:
> |     try
> |             try
> |                     while 1
> |                     end
> |             catch
> |                     disp('Catch 1')
> |             end
> |             disp('foo')
> |     catch
> |             disp('Catch 2')
> |     end
> | 
> | After hitting Ctrl-C in order to break the infinite loop, I'd like to
> | continue with the line that displays 'foo' (that's the way matlab handles
> | the keyboard interrupt), but octave skips to the next catch block instead.
> | How can I fix this?
> You'd have to modify the sources.

Unfortunately, that's not really an option here because I'm working on
some octave code that we'll eventually distribute to students who are
taking engineering math classes, and we want everything to work out of
the box because we can't expect our students to be able to compile their
own version of octave (offering my own binaries for all the systems out
there wouldn't be practical either).

> Since an interrupt (Ctrl-C) is supposed to eventually send you back to
> the prompt, I'm not sure that the Matlab behavior is really best.

I see your point. I think the ideal solution would be an internal boolean
variable like 'resume_after_keyboard_interrupt' so users get to chose which
behavior they prefer.

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]