Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use xtermcontrol with UNIX
There is a utility designed for use with xterm(1), the standard X-Windows terminal program, called xtermcontrol. It's source can be downloaded from the developer's website , and it may also be available as a Fink package. On my 10.3.8 system, it compiled and ran out of the box.

Anyway, it turns out that since implements a subset of the standard xterm/ANSI escape sequences, many of the functions of xtermcontrol will work inside a Terminal window (of course, they all work inside an xterm window). I tried it with iTerm, and it doesn't work well; I haven't tried other terminal-style programs. xtermcontrol checks the TERM variable and will complain if it doesn't find xterm in it. In my Terminal windows, I always set TERM=xterm-color anyway.

For example, you can set the window title with:
xtermcontrol --title="My Window Title"
Or set the window size and location with:
xtermcontrol --geometry=80x25+200+400
You can also find out the current size and so on. You can find out all of the commands using the --help flag. The color and font commands don't seem to work, but many of the others do. You just have to use trial and error. A visually interesting command line to try is:
say goodbye ; xtermcontrol --iconify ; sleep 5 ; xtermcontrol \
 --de-iconify; say hello
If you were sufficiently interested, and had too much time on your hands, you could choreograph a whole "Terminal ballet" with xtermcontrol and sleep (with xterm, you also can change the colors "on the fly").

Caution: A few of the unimplemented commands will cause the Terminal window to get hung (waiting to read a response from the window that doesn't come). The fix is to do a ps a command from another window, and kill the stuck xtermcontrol process.

This program might be especially useful for things like putting the date and time in the title, and from within shellscript.command applications.
  • Currently 2.20 / 5
  You rated: 1 / 5 (5 votes cast)

Use xtermcontrol with | 4 comments | Create New Account
Click here to return to the 'Use xtermcontrol with' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use xtermcontrol with
Authored by: adrianm on Feb 25, '05 10:22:09AM


With, of course, you can script it via osascript too.

I'm sure there are examples on macosxhints, but take a look in Terminal's dictionary to see what you can do.

[ Reply to This | # ]
Yes - it is in fink
Authored by: goatbar on Feb 25, '05 11:08:20AM

Yup. It is in fink. I put it there :) It is under unstable, so you will have to go into the fin commander preferences under fink and turn on unstable packages.

Thanks for writing the hint on it!

[ Reply to This | # ]
Use xtermcontrol with
Authored by: merlyn on Feb 25, '05 06:07:50PM

It's not a fink package or a darwinports port. Too bad.

[ Reply to This | # ]
Use xtermcontrol with
Authored by: danavery on Feb 25, '05 06:58:50PM
I couldn't find the fink package either...then I ran into 4.2 I haven't had any package updates from Fink in a while. To get around a bug in fink-0.22.0, it says to use cvs fink updates (once) instead of rsync. I did that, and the xtermcontrol package showed up (along with a whole bunch of other updates that had apparently been pending).

[ Reply to This | # ]