From: Kevan H. <ha...@br...> - 2006-08-17 12:34:55
|
Dear Brian, > Correct me if I'm wrong, but don't *all* shells work this way? Try this: You're right. And I now see the logic: the open Wish window means that the script has not yet finished its job. As soon as the windows closes, the job is done. > proc con {{prompt "% "}} { > fileevent stdin readable invoke > fconfigure stdin -buffering line > set ::P1 $prompt > prompt $::P1 > } > > proc prompt {prompt} { > puts -nonewline stdout $prompt > flush stdout > } > > proc invoke {} { > gets stdin line > catch {uplevel $line} res > puts stdout $res > prompt $::P1 > } > > con Well, sir, I stand in awe of your prowess. (Well, strictly speaking I'm sitting in awe, but the awe is genuine.) This is a beautiful piece of code. So simple and so effective. > Add this to your test.tcl and you should get the behavior you seek. I did, and it works perfectly. Thank you very much. Yours, Kevan. -- Kevan Hashemi, Electrical Engineer Physics Department, Brandeis University http://alignment.hep.brandeis.edu/ |