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 <[email protected]>
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