From: udaya kumar on
Hi all,

While running a tcl script in tclsh,
I want block keystroke combinatination ctrl+c so that my program can
run in uninterrupted environment.

Can somebody suggest a solution for this.

Regards,
uday
From: tom.rmadilo on
On Sep 2, 8:49 pm, udaya kumar <udayakumarsa...(a)gmail.com> wrote:
> Hi all,
>
> While running a tcl script in tclsh,
> I want block keystroke combinatination ctrl+c so that my program can
> run in uninterrupted environment.
>
> Can somebody suggest a solution for this.

On *nix systems you can just put the script into the background:

$ tclsh myscript.tcl &

On both windows and *nix you can use job control features of the
shell.

My personal favorite system is daemontools which starts/stops/pauses/
restarts etc. a foreground application. It is much easier to work with
foreground running applications and daemontools (http://cr.yp.to/
daemontools/svc.html) works great.

Since the program is not running on a console, you can't really send
keyboard commands to it.
From: Georgios Petasis on
O/H udaya kumar έγραψε:
> Hi all,
>
> While running a tcl script in tclsh,
> I want block keystroke combinatination ctrl+c so that my program can
> run in uninterrupted environment.
>
> Can somebody suggest a solution for this.
>
> Regards,
> uday

http://wiki.tcl.tk/1886

George
From: dkf on
On 3 Sep, 09:24, Georgios Petasis <peta...(a)iit.demokritos.gr> wrote:
> http://wiki.tcl.tk/1886

The other possibility is to use the stty utility to switch the
terminal into raw mode. Like that the program will still respond to
the signal, but Ctrl+C won't generate it.

Donal.
From: Uwe Klein on
dkf wrote:
> On 3 Sep, 09:24, Georgios Petasis <peta...(a)iit.demokritos.gr> wrote:
>
>>http://wiki.tcl.tk/1886
>
>
> The other possibility is to use the stty utility to switch the
> terminal into raw mode. Like that the program will still respond to
> the signal, but Ctrl+C won't generate it.
>
TclX and
package require tclX
signal -restart ignore SIGINT

expect
package require expect
trap SIG_IGN SIGINT

have signal handling ( for unixies ).

set the signal handler to ignore or insert your
own handler for SIGINT

uwe