If you're really worried about buffering the output of the commands, why would you put it in a Tk widget at all? That will take up more memory than just the string output.
Also: IIRC matlab has a "shell" interface, which means you don't start matlab itself for each command, instead you start it once, and then send commands to its STDIN and read its STDOUT for the output. That can get complicated (mainly because you can run into deadlocks) but it's certainly possible. See perlipc and IPC::Open3 and Tk::fileevent.
Update: If it's possible in your situation, you can simplify your program by using the Tk::Text (or Tk::ROText) widget for output only, and let the user enter the commands in a seperate text field below the output widget. That way you won't have to do all kinds of funky things with the keyboard events.
In reply to Re: tty in Tk app
by Joost
in thread tty in Tk app
by gri6507
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |