Visit Our UNIX and Linux User Community


Change the window name for putty


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Change the window name for putty
# 1  
Old 01-06-2012
Java Change the window name for putty

Hi everyone ,

Happy new year !

I have a question , hope someone will respond to me .

I will be logging into so many servers in the same putty . So , whenever i loggedoff and loggedin into anonther server , putty window will change accordingly to the server name .

If the above is not clear . hope it will be clear with below example .

Example : I will login into the putty , then i have logged into one server , say SERVER1 so here putty window name should change as SERVER1 , then i logged off from SERVER1 and logged into SERVER2 , now the putty window name should change to SERVER2 .

Thanks in advance .
# 2  
Old 01-06-2012
In the setup of your session go to

Windows -> Behaviour
in the right frame you can setup the Windows Title, just put the name of the server corresponding to the session and save your session.
# 3  
Old 01-06-2012
PUTTY obeys the same escape sequences as xterm does to change its window title, so if your window titles aren't changing already, you can get PUTTY to do so easily enough. Try this code in any of your PUTTY terminals:

Code:
printf "\033]0;asdf\007"

It should set your window title to asdf. You can put that code in your PS1 variable as shown here so it changes the title every single time your shell prompts you.

If printf from the prompt didn't work, that means your prompt is already changing your window title every single line, changing it back before you could see.
# 4  
Old 01-09-2012
Quote:
Originally Posted by Corona688
PUTTY obeys the same escape sequences as xterm does to change its window title, so if your window titles aren't changing already, you can get PUTTY to do so easily enough. Try this code in any of your PUTTY terminals:

Code:
printf "\033]0;asdf\007"

It should set your window title to asdf. You can put that code in your PS1 variable as shown here so it changes the title every single time your shell prompts you.

If printf from the prompt didn't work, that means your prompt is already changing your window title every single line, changing it back before you could see.
Yes .. it worked !!!

Thanks man .. Smilie
This User Gave Thanks to radha254 For This Post:
# 5  
Old 01-16-2012
Question

Hi Guys ,

I have added like the same in my PS1 . Today i have encountered a problem like
1.its not working for all servers and Smilie
2.the window title is not changing even i logged out also Smilie

Please help me in this also ..
# 6  
Old 01-17-2012
Code:
\033]0;jchada@lpdma561\007

see after logging into servers , this escape character is not working . Hope I am clear with my issue.
# 7  
Old 01-17-2012
Different shells use PS1 in different ways. The same code may not work identically everywhere. Look at the different examples for different systems and shells in that link.

Some systems may be trying to change your window title already, too. Try leaving it out of PS1 and trying the printf line I gave you earlier. If it doesn't work, something else is changing your window title every line...

Previous Thread | Next Thread
Test Your Knowledge in Computers #738
Difficulty: Medium
RadioShack introduced a 50 MB external hard disk for the TRS-80 Model III/4 in 1983.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Getting command output to putty window title.

Hi, Last 2 weeks I have searched many forums and i haven't found the answer for the question: How to get all command output to Putty title? Needed it for other programs to know when some jobs on a server is done and is it done right or wrong. Plink stdout and stdin wasn't working, i used many... (1 Reply)
Discussion started by: domagaj
1 Replies

2. Shell Programming and Scripting

Help with putty window setting

hi friends, This is not a shell scripting related doubt, but still posting so that you can answer it ;) or redirect to correct place in this website. Many a times i have to open multiple putty sessions by duplicating a session and want to rename their tabs. For this activity i have to right... (4 Replies)
Discussion started by: kunwar
4 Replies

3. Shell Programming and Scripting

Remotely setting putty window title

I have successfully used a script to modify putty's window title for many years. It has worked great in a Solaris 10 environment, using, sh, bash and tcsh. But I've never been able to get it to work in linux :( The script relies on sending escape sequences via gnu echo. The version of echo on... (4 Replies)
Discussion started by: tsreyb
4 Replies

4. UNIX for Dummies Questions & Answers

Putty - window size

Hi Guys, When I use putty and maximize it, then the second half of the emulator window is not utilized and used! I mean the mouse cursor is at the half of the page not at the bottom! i have to once minimize and maximize the window to tell putty that i am going to use the maxmized window...is... (4 Replies)
Discussion started by: messi777
4 Replies

5. Red Hat

How to set xterm for Window Titls for PuTTy

Hi, I still cant find step by step manual how to make my putty display let say PWD in its title, read about some xterm, but where it is? Can anybody help me with this. Thx M (4 Replies)
Discussion started by: trento17
4 Replies

6. UNIX for Advanced & Expert Users

How to connect ubuntu through putty from Window?

Hii, i have installed ubuntu in windows without make partitioning by using wubi.. i want to connect ubuntu linux through putty. but I am unable to do that. Please help me.. how to set ip address in putty (3 Replies)
Discussion started by: pankajkumar
3 Replies

7. Linux

Opening a GUI from a putty window on Linux

Hi, I have a linux which I am accessing using putty.I have written some code in TCL-Tk & developed a GUI based app.I knew that it is difficult to open a GUI based app. from putty,but there must be some way to do that. If anybody knows any such workarounds kindly let me know. Shell I am using is... (4 Replies)
Discussion started by: forstudy3
4 Replies

8. Shell Programming and Scripting

How do I Get the Title of My Putty Window (Emulating an XTerm)

I have a Perl script that changes the terminal window title and I would like to reset it to the original value when I am done. We are using Putty which emulates xterm. We are not running X-Windows so I can't use something like xprop (can I?). I'm using XTerm control codes to change the title and I... (2 Replies)
Discussion started by: NateTut
2 Replies

9. UNIX for Advanced & Expert Users

putty title window?

I have implemented the solution from mschwage located in post https://www.unix.com/unix-advanced-expert-users/35784-change-putty-title-window.html; ie wt () { echo -n "^2;${@}^G" } This method is awesome!!!! The reason I am sending you this message is to get your assistance with... (3 Replies)
Discussion started by: lwif
3 Replies

10. 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

Featured Tech Videos