Change Console Title


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Change Console Title
# 1  
Old 06-09-2004
Change Console Title

Hello.

I am trying to figure out how to change the title of my console window. I don't need it to dynamically change with my current directory. I just want to be able to change the name of it, so when I minimize the window I can see which windows are for what purpose.

I've tried using the following, but it returns back saying that TITLE is an undefined variable.

echo "^[]l${TITLE}^[\\"

Any and all help is greatly appreciated.

Thanks.
# 2  
Old 06-09-2004
I have a one-line script which I use called "title"...

$ cat title
#----script to set window title
print "\033]0;$*"

...use it like this...

$ title New Window Title

...however, it may not work for all terminal types or emulators.
# 3  
Old 06-09-2004
Hi,

I use a slightly different command
Code:
echo "^[]0;$*^G"

Does the same thing as Ygor's script, and seems to work on all vt100 compatibles.

Cheers
ZB
# 4  
Old 06-09-2004
Thanks for your help Ygor and Zazzybob.

However, I have been unable to get either method to work.

Ygor,

I created the title script using the VI editor. I modified the script to have rwx for all. When I ran the script just like you suggested...

# title New Window Title

it returned,

title: print: not found

Do you have any idea what I could be doing wrong? I am running on an emulator using the Exceed software. Would this have anything to do with my problem?

The OS is Solaris 6.


Zazzybob,

I also tried running your command from the command line. All it seems to do is echo back

^[]0;^G


The title bar still says console.
# 5  
Old 06-09-2004
Hi, maybe I should have elaborated.

Create a script called, say, set_title.sh

In vi, insert this code....
Code:
#!/bin/sh

echo "^[]0;$*^G"

The ^[ is produced using the keystroke CTRL-V then ESC

The ^G is produced using the keystroke CTRL-G (on some terminals CTRL-V then CTRL-G)

Then, invoke the code at the prompt with

./set_title.sh My new window title

Cheers
ZB

Last edited by zazzybob; 06-09-2004 at 08:53 AM..
# 6  
Old 06-09-2004
Thanks Zazzybob!!!

Sorry that you had to spell it out for me. I really appreciate your help though.

Cheers,

medmonson
# 7  
Old 06-09-2004
Some shells have "print" built-in, but its just the same as "echo".

Incidentally, "CTRL-V then ESC" is the same as "\033". See man ascii.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Change title of a thread after it is created

hi, how do we change the title of a thread after it is created? Thanks (5 Replies)
Discussion started by: milhan
5 Replies

2. UNIX for Beginners Questions & Answers

Delete columns with a specific title XXX, where the position change in each file

Goodmorning, I know how to cut a string and a column, and how to find a word. I have a file with over 100 columns. All columns have a title in the first line. I have to delete all columns with the XXX title. I can't use cut -f because the position of XXX columns change in each file, and in... (14 Replies)
Discussion started by: echo manolis
14 Replies

3. UNIX for Dummies Questions & Answers

Change putty title name

Hello all, I have a not so unix question for you guys(or maybe it is). I use PUTTY to login to serverA (my putty title shows as serverA.domainname.com) Now from ServerA i do ssh user@ServerB (i have ssh public private key setup)... now my question is when i do ssh and logon to... (20 Replies)
Discussion started by: abdul.irfan2
20 Replies

4. Shell Programming and Scripting

How to change the title bar of the terminal screen

Hi, How to change the value after the symbol '@' ? $ i.e. @mac1 I want to change it to @prod2 Also need to change the same in the title bar on the top when we open a new terminal. (3 Replies)
Discussion started by: milink
3 Replies

5. AIX

How to change cronjob title?

Once I type "mail" command, I got to see the mail like below: > 1 daemon Thu Aug 12 17:31 31/938 "Output from cron job " My question is, how to do change the default title "Output from cron job " to be more customized title? Thanks. (4 Replies)
Discussion started by: ngaisteve1
4 Replies

6. UNIX for Advanced & Expert Users

Change title of aixterm window online

Is there any way to change title of aixterm window online? Also is it possible to freeze first/last few lines online? (1 Reply)
Discussion started by: Soham
1 Replies

7. UNIX for Advanced & Expert Users

Change putty title window?

Is it possible to change the putty window title from a Unix command line? (12 Replies)
Discussion started by: akbar
12 Replies

8. Solaris

Change Terminal Title

Is it possible to change the title of a Terminal window on Solaris? For example, for a MS Windows command window, one can simply type "title NameofWindow" to change the title for a command window. I was looking for similar functionality for terminal windows. Thanks. (8 Replies)
Discussion started by: here2learn
8 Replies
Login or Register to Ask a Question