From: udaya kumar on 2 Sep 2009 23:49 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 3 Sep 2009 02:39 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 3 Sep 2009 04:24 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 3 Sep 2009 05:06 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 3 Sep 2009 05:42 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
|
Next
|
Last
Pages: 1 2 Prev: server socket and multiple clients Next: How to detect if event loop is running ? |