tkterm

tkterm is a terminal emulator similar to xterm except that it can be used inside of a Tk script. Unlike a true xterm, you can query the tkterm to see what's on it and you can update the display manually if desired. tkterm is implemented by some clever Expect scripting that uses a pty and a Tk text widget to achieve fast and accurate terminal emulation.

Tkterm supports vi, emacs, and other character-graphic programs built using curses, termcap, or terminfo. (Tkterm also support non-character graphic programs so you run your shell in it and switch back and forth between smart and dumb modes.) Tkterm's most recent enhancement is to automatically provide scrollbars while in 'dumb' mode [L1 ].

tkterm can be found in the example directory of the Expect distribution: http://expect.nist.gov although the distributed version is a bit rickety; a fixed and extended version and a working version of virterm, which does the same but doesn't require X, can be found in https://github.com/martinwguy/xvi/blob/2.50/test/scripts


NEM 18May2003 - Just tried tkterm for the first time. When I run vi (which is aliased to Vim), I get a message about "unknown terminal: defaulting to ANSI" and then vi just hangs. Any ideas how to fix this?

escargo - What environment are you running in? If you are running in a UNIX-like environment, what is the value of your TERM environment variable?

Does Tkterm support "answer back" strings? In the "old days" systems connected to terminals would determine the terminal type based on the results of a query string sent to the terminal. I don't know if that is still true or not, but Tkterm behavior in that regard would be worth knowing.

Martinwguy: No.

NEM - Environment:

 $ uname -a
 Linux latimer 2.4.19-4GB #1 Mon Oct 14 22:11:39 UTC 2002 i686 unknown
 $ echo $TERM
 xterm

No idea what tkterm supports in terms of functionality, or how it works at all. Just thought it would be neat to have Vim running in a Tk window ;)

NEM - Update. My problem has been fixed now. Search google groups archive of c.l.t. for a post by Don Libes (in a thread called "looking for tkterm + scrollbars (pterm, maybe?)" which contains updated code. The problem was with something not liking the terminal name "tt", as it is too short. Don changed it to "tkterm" and now it works ok.


Bruce Stephens updated it to his "Pterm".