Re: Changing Window Title in Putty
On 11/04/2016 2:04 AM, Aero Maxx wrote: > So what is $PROMPT_COMMAND actually for ? is this the command prompt or > the windows title. This from the prior reference page: PROMPT_COMMAND Bash shell executes the content of the PROMPT_COMMAND just before displaying the PS1 variable. And that page again: http://www.thegeekstuff.com/2008/09/bash-shell-take-control-of-ps1-ps2-ps3-ps4-and-prompt_command/ Cheers A. signature.asc Description: OpenPGP digital signature
Re: Changing Window Title in Putty
I believe I have the command prompt set correctly as to how I want it. For this I want it to show at all times, regardless of if I am in a screen or not. "[root@localhost ~]# " For the window title in whatever ssh client I happen to be using I would like it to be as follows when not in a screen session "root@localhost:~" When I am in a screen I want the windows title to show "[screen 0: root@localhost ~]# " At present I have managed to get the window title to be correct when not in a screen, but when I am in a screen it shows as follows "[screen 0: bash] root@localhost ~ " In Fedora $PROMPT_COMMAND is set with xterm*|vte*) PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' ;; screen*) PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' ;; In Debian $PROMPT_COMMAND isn't set with anything. I'm a little more confused now as I thought $PS1 was for the command prompt as this has a setting for it to be coloured in the .bashrc file, and obviously the window title bar wouldn't pay any attention to the colours. So what is $PROMPT_COMMAND actually for ? is this the command prompt or the windows title. On 10/04/2016 15:21, John L. Ries wrote: You definitely confused me, and I'm still not entirely sure what you want. But you can set the window title for a PuTTY session and keep it from changing in the manner I described in my initial response. I assume you have a different PuTTY profile for each server to which you connect, so there should be no difficulty in customizing each to get the desired behavior. Regardless, your settings on each server are only relevant to window titles if you want the server to control them instead of your terminal emulator; and in that case, it would be helpful to know such gory details as what shell you're running on the server, and what you actually want displayed locally. I assume you're discussing windows on your local desktop, in which case, .screenrc is irrelevant (that only governs screen sessions). On April 10, 2016 7:25:06 AM MDT, Aero Maxx wrote: On 10/04/2016 14:13, Andrew McGlashan wrote: You see I had to change the /etc/screenrc file and turn the hardstatus line to show that I was in a screen. Well, you did ask specifically about putty and the solution would do what is needed for putty. In which case, it wouldn't matter what the /etc/screen settings are. Ok well perhaps that was some confusion there as I merely meant that I was using putty, but the window title would appear in other programs also, not just putty. I think your getting confused as what I want to do has nothing to do with putty. "Changing Window Title in Putty" -- subject line? As I can also use terminal on my Apple Mac and it also shows the window title different on the two servers which I am comparing, so if one shows it how I want and the other one does not, and the putty client or whatever client has the configurations identically for each server, then the only thing that must be different is the server itself surely, as they have both been configured the same do you follow me ? Yes, I follow. The other thing you can do is adjust the PS1 / PS2 lines on the terminal. That won't involve putty or screen settings A. I've played about with the PS1 line, I wasn't aware of a PS2 line, I've done as much as I am able to on my own through trial and error. This is what appear on fedora [screen 0: user@localhost:~] This is what appears on debian 8 [screen 0: bash] user@localhost:~ See the difference? i'd like the debian 8 one to be the same as the fedora one if at all possible. I guess this is merely a file change somewhere but I am unable to find what I need to change to get it to be the same. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -- Sent from my Android device with K-9 Mail. Please excuse my brevity. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Re: Changing Window Title in Putty
You definitely confused me, and I'm still not entirely sure what you want. But you can set the window title for a PuTTY session and keep it from changing in the manner I described in my initial response. I assume you have a different PuTTY profile for each server to which you connect, so there should be no difficulty in customizing each to get the desired behavior. Regardless, your settings on each server are only relevant to window titles if you want the server to control them instead of your terminal emulator; and in that case, it would be helpful to know such gory details as what shell you're running on the server, and what you actually want displayed locally. I assume you're discussing windows on your local desktop, in which case, .screenrc is irrelevant (that only governs screen sessions). On April 10, 2016 7:25:06 AM MDT, Aero Maxx wrote: > > >On 10/04/2016 14:13, Andrew McGlashan wrote: >>> You see I had to change the /etc/screenrc file and turn the >hardstatus >>> line to show that I was in a screen. >> Well, you did ask specifically about putty and the solution would do >> what is needed for putty. In which case, it wouldn't matter what the >> /etc/screen settings are. > >Ok well perhaps that was some confusion there as I merely meant that I >was using putty, but the window title would appear in other programs >also, not just putty. > >> >>> I think your getting confused as what I want to do has nothing to do >>> with putty. >> "Changing Window Title in Putty" -- subject line? >> >>> As I can also use terminal on my Apple Mac and it also shows the >window >>> title different on the two servers which I am comparing, so if one >shows >>> it how I want and the other one does not, and the putty client or >>> whatever client has the configurations identically for each server, >then >>> the only thing that must be different is the server itself surely, >as >>> they have both been configured the same do you follow me ? >> Yes, I follow. >> >> The other thing you can do is adjust the PS1 / PS2 lines on the >> terminal. That won't involve putty or screen settings >> >> A. >> >I've played about with the PS1 line, I wasn't aware of a PS2 line, > >I've done as much as I am able to on my own through trial and error. > >This is what appear on fedora > [screen 0: user@localhost:~] > >This is what appears on debian 8 > [screen 0: bash] user@localhost:~ > >See the difference? i'd like the debian 8 one to be the same as the >fedora one if at all possible. >I guess this is merely a file change somewhere but I am unable to find >what I need to change to get it to be the same. > > >--- >This email has been checked for viruses by Avast antivirus software. >https://www.avast.com/antivirus -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Re: Changing Window Title in Putty
On 10/04/2016 11:25 PM, Aero Maxx wrote: > I've played about with the PS1 line, I wasn't aware of a PS2 line, http://www.thegeekstuff.com/2008/09/bash-shell-take-control-of-ps1-ps2-ps3-ps4-and-prompt_command/ > I've done as much as I am able to on my own through trial and error. > > This is what appear on fedora > [screen 0: user@localhost:~] > > This is what appears on debian 8 > [screen 0: bash] user@localhost:~ > > See the difference? i'd like the debian 8 one to be the same as the > fedora one if at all possible. > I guess this is merely a file change somewhere but I am unable to find > what I need to change to get it to be the same. Does localhost show the actual hostname? That would be better. Anyway the link above should help you get a nice PS1/PS2 setup where you can tell the user and the host easily and quickly Cheers A.
Re: Changing Window Title in Putty
On 10/04/2016 14:13, Andrew McGlashan wrote: You see I had to change the /etc/screenrc file and turn the hardstatus line to show that I was in a screen. Well, you did ask specifically about putty and the solution would do what is needed for putty. In which case, it wouldn't matter what the /etc/screen settings are. Ok well perhaps that was some confusion there as I merely meant that I was using putty, but the window title would appear in other programs also, not just putty. I think your getting confused as what I want to do has nothing to do with putty. "Changing Window Title in Putty" -- subject line? As I can also use terminal on my Apple Mac and it also shows the window title different on the two servers which I am comparing, so if one shows it how I want and the other one does not, and the putty client or whatever client has the configurations identically for each server, then the only thing that must be different is the server itself surely, as they have both been configured the same do you follow me ? Yes, I follow. The other thing you can do is adjust the PS1 / PS2 lines on the terminal. That won't involve putty or screen settings A. I've played about with the PS1 line, I wasn't aware of a PS2 line, I've done as much as I am able to on my own through trial and error. This is what appear on fedora [screen 0: user@localhost:~] This is what appears on debian 8 [screen 0: bash] user@localhost:~ See the difference? i'd like the debian 8 one to be the same as the fedora one if at all possible. I guess this is merely a file change somewhere but I am unable to find what I need to change to get it to be the same. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Re: Changing Window Title in Putty
> You see I had to change the /etc/screenrc file and turn the hardstatus > line to show that I was in a screen. Well, you did ask specifically about putty and the solution would do what is needed for putty. In which case, it wouldn't matter what the /etc/screen settings are. > I think your getting confused as what I want to do has nothing to do > with putty. "Changing Window Title in Putty" -- subject line? > As I can also use terminal on my Apple Mac and it also shows the window > title different on the two servers which I am comparing, so if one shows > it how I want and the other one does not, and the putty client or > whatever client has the configurations identically for each server, then > the only thing that must be different is the server itself surely, as > they have both been configured the same do you follow me ? Yes, I follow. The other thing you can do is adjust the PS1 / PS2 lines on the terminal. That won't involve putty or screen settings A. signature.asc Description: OpenPGP digital signature
Re: Changing Window Title in Putty
On 10/04/2016 09:14, Andrew McGlashan wrote: The first thing I do with Putty is adjust the "default settings" to my liking, save it and then use that as a base for new entries for each server that I need to connect to; I save each server's settings. That lends itself well to giving each saved session it's own window title in the manner that you've been given. It's the perfect answer for you. Cheers A. Actually it's not. You see I had to change the /etc/screenrc file and turn the hardstatus line to show that I was in a screen. I think your getting confused as what I want to do has nothing to do with putty. As I can also use terminal on my Apple Mac and it also shows the window title different on the two servers which I am comparing, so if one shows it how I want and the other one does not, and the putty client or whatever client has the configurations identically for each server, then the only thing that must be different is the server itself surely, as they have both been configured the same do you follow me ? --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Re: Changing Window Title in Putty
The first thing I do with Putty is adjust the "default settings" to my liking, save it and then use that as a base for new entries for each server that I need to connect to; I save each server's settings. That lends itself well to giving each saved session it's own window title in the manner that you've been given. It's the perfect answer for you. Cheers A. signature.asc Description: OpenPGP digital signature
Re: Changing Window Title in Putty
On 10/04/2016 04:24, Andrew McGlashan wrote: On 10/04/2016 6:12 AM, Aero Maxx wrote: I only have ssh access to the server, no gui. Umm, the instruction looks very good for putty as you asked for. Which version of putty are you using and what type of machine are you running it from? A. That maybe the case but it's nothing something in putty that I need to change. When I use the same putty client to log into both a debian 8 server and a fedora server, the fedora one has the window title how I want it, the debian server has the window title different. So I must need to change a file on debian surely else why would they be different when using the same putty client and having it configured the same for both servers. Thanks, Daniel. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Re: Changing Window Title in Putty
On 10/04/2016 6:12 AM, Aero Maxx wrote: > I only have ssh access to the server, no gui. Umm, the instruction looks very good for putty as you asked for. Which version of putty are you using and what type of machine are you running it from? A.
Re: Changing Window Title in Putty
I only have ssh access to the server, no gui. On 09/04/2016 19:05, John L. Ries wrote: I may be misunderstanding you but: 1. Load the session configuration. 2. Select Terminal/Features. Check "Disable remote-controlled window title changing". 3. Select Window/Behavior. Fill in the Window title as seems good to you. 4. Go back to Session. Click on the Save button. --| John L. Ries | Salford Systems | Phone: (619)543-8880 x107 | or (435)867-8885 | --| On Saturday 2016-04-09 07:29, Aero Maxx wrote: Date: Sat, 9 Apr 2016 07:29:17 From: Aero Maxx To: "debian-user@lists.debian.org" Subject: Changing Window Title in Putty Resent-Date: Sat, 9 Apr 2016 13:29:38 + Resent-From: Hi Everyone, I am currently running 2 servers on my home network the main one being a fedora server, and the other being a debian server. I'm wanting to change the fedora server to run debian instead, but using the other server to try it out and have it set up the same. I think I am almost there, but I am finding it difficult to work out how to change the window tile. I've editted the /etc/screenrc file, and turned on the hardstatus. I've also changed the hardstatus string to "[screen %n%?: %t%?] %h". That has sort of done half of what I was wanting in that is now shows [screen 0: bash] in the title bar so I am able to see that I am in a screen, as sometimes I forget. When I am not in a screen the window title shows user@localhost:~ I'd like this to be able to replace bash with this as this is how it appears on fedora. I have played around with the .bashrc file in /home/user/.bashrc and have managed to get the window title to now be "[screen 0: bash] user@localhost:~" in the window title. I guess this is ok, but I would be interested to know how to replace bash in the title bar still as am unsure where this is coming from. Thanks, Daniel --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Re: Changing Window Title in Putty
I may be misunderstanding you but: 1. Load the session configuration. 2. Select Terminal/Features. Check "Disable remote-controlled window title changing". 3. Select Window/Behavior. Fill in the Window title as seems good to you. 4. Go back to Session. Click on the Save button. --| John L. Ries | Salford Systems | Phone: (619)543-8880 x107 | or (435)867-8885 | --| On Saturday 2016-04-09 07:29, Aero Maxx wrote: Date: Sat, 9 Apr 2016 07:29:17 From: Aero Maxx To: "debian-user@lists.debian.org" Subject: Changing Window Title in Putty Resent-Date: Sat, 9 Apr 2016 13:29:38 + Resent-From: Hi Everyone, I am currently running 2 servers on my home network the main one being a fedora server, and the other being a debian server. I'm wanting to change the fedora server to run debian instead, but using the other server to try it out and have it set up the same. I think I am almost there, but I am finding it difficult to work out how to change the window tile. I've editted the /etc/screenrc file, and turned on the hardstatus. I've also changed the hardstatus string to "[screen %n%?: %t%?] %h". That has sort of done half of what I was wanting in that is now shows [screen 0: bash] in the title bar so I am able to see that I am in a screen, as sometimes I forget. When I am not in a screen the window title shows user@localhost:~ I'd like this to be able to replace bash with this as this is how it appears on fedora. I have played around with the .bashrc file in /home/user/.bashrc and have managed to get the window title to now be "[screen 0: bash] user@localhost:~" in the window title. I guess this is ok, but I would be interested to know how to replace bash in the title bar still as am unsure where this is coming from. Thanks, Daniel --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Changing Window Title in Putty
Hi Everyone, I am currently running 2 servers on my home network the main one being a fedora server, and the other being a debian server. I'm wanting to change the fedora server to run debian instead, but using the other server to try it out and have it set up the same. I think I am almost there, but I am finding it difficult to work out how to change the window tile. I've editted the /etc/screenrc file, and turned on the hardstatus. I've also changed the hardstatus string to "[screen %n%?: %t%?] %h". That has sort of done half of what I was wanting in that is now shows [screen 0: bash] in the title bar so I am able to see that I am in a screen, as sometimes I forget. When I am not in a screen the window title shows user@localhost:~ I'd like this to be able to replace bash with this as this is how it appears on fedora. I have played around with the .bashrc file in /home/user/.bashrc and have managed to get the window title to now be "[screen 0: bash] user@localhost:~" in the window title. I guess this is ok, but I would be interested to know how to replace bash in the title bar still as am unsure where this is coming from. Thanks, Daniel --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus