SUPPORT > TIPS
Send us a question or comment

   

Displaying Text In The SecureCRT® Title Bar

It can be useful to have the SecureCRT title bar update dynamically, especially when using multiple concurrent SecureCRT sessions. There is an option in your Session Options that allows you to statically set the title bar for a particular SecureCRT window. However, this is not always sufficient.

If you need to place information in the SecureCRT title bar dynamically, SecureCRT supports the standard xterm escape sequences for changing the window title bar.

These escape sequences can be sent from the remote system by a variety of means, and allow you to change how the SecureCRT title bar is displayed arbitrarily.

If the remote system sends the following, SecureCRT places "sometext" in the title bar of the SecureCRT window.

ESC ] ; sometext CTRL+G

The following Perl script demonstrates this functionality.

---
#! /usr/bin/perl
# title.pl - sends xterm escape sequence to
# change window title to @ARGV

$esc = "\x1b";
$bel = "\x7";

$txt = join(" ", @ARGV);

print $esc, "];", $txt, $bel;
---

When run from your shell on the remote, it will take any arguments as text to display in the title bar.

For example, if run on a Un*x system:

% title.pl $user@$host\:`pwd`

would place something similar to the following in the SecureCRT title bar.

someuser@somehost:/tmp

The text would depend, of course, on the values of $user, $host, and the current working directory.

There are many possible applications. One common use is to hard-code the escape sequence into your shell prompt, or use a similar mechanism, so that each time you use the cd command on a Un*x host, for example, the title bar is changed to reflect the current working directory, or whatever you want displayed in the title bar.

For additional information on xterm escape sequences, refer to the following web links.

FAQS.org provides specific instructions on this technique:

http://www.faqs.org/faqs/x-faq/part2/section-15.html

MIT provides an exhaustive list of escape sequences:

http://www.mit.edu/afs/athena/system/x11r4/src/mit/clients/xterm/ctlseq2.txt

http://www.vandyke.com/support/tips/vbswin.html

Was this information helpful?
Yes No
Thank you!
Send your comments and questions to VanDyke Software Support,
or join the discussion in the VanDyke Software Forums.
Can't find the answer you're looking for?
Ask VanDyke Software Support directly
and we will get back to you as soon as possible.
1.  Read or download one of our secure solutions white papers. 2.  Download a free
30-day evaluation copy of our products.
3.  Let us help define the right Secure Shell solution for your company. 4.  Subscribe to our What's New page for tips, solution ideas, and product news.