#! @PERL@
#
# file: $ISIP_IFC/util/misc/isip_change_xterm_title/isip_change_xterm_title
#
$ISIP_HELP_FILE = <<__ISIP_HELP_HERE_FILE__;
name: isip_change_xterm_title
synopsis: isip_change_xterm_title <new_name>
descr: this program changes the name of the current xterm to the name given
       by the user. multiple white spaces in the string are collapsed.

options:
 -help: display this help message

arguments:
 new_name: desired name for the window

man page: none
__ISIP_HELP_HERE_FILE__

# return: none
#

# define the program name
#
@tmp = split(/\//, $0);
$ISIP_PROG = pop(@tmp);

# define command line options
#

# load the command_line module
#
require "$ENV{ISIP_DEVEL}/lib/scripts/perl/command_line.pm";

# parse the command line.
#
(@new_name) = command_line(-1);

# create the new xterm string and write it to stdout
# this line consists of ESC ] 0;new_name CTRL-G
# where ESC is the literal escape (\e)
#       CTRL-G is the literal control character
# there are no spaces between each character
#
printf STDOUT "\e]0;@new_name\cG\n";

# end of file
#
