#1
|
|||
|
|||
Tab/Title bar not changing on logout
Hi!
I'm using echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD/#$HOME/~}\007" to set my tab/title bar and it works fine when I login to a machine and then ssh to a second machine from there but when I log out of the second machine the title isn't reset - any idea why? Cheers. |
#2
|
|||
|
|||
Hi cbeck,
Thanks for the question. Are you issuing the command after exiting the connection to the secondary machine? Have you added this prompt to your PS1 or PROMPT_COMMAND variables? What version of SecureCRT are you using? |
#3
|
|||
|
|||
Hi cbeck,
Are you using Xterm for the emulation when connecting to the first machine? What shell are you using? I am asking these follow-up questions because this should work if you are using Bash for your shell on both machines, and you are using the Xterm emulation when connecting to the first machine. |
#4
|
|||
|
|||
Hi!
I'm using bash on both machines, Linux emulation. The echo line goes in my .bashrc just above the export PS1 command. You are suggesting that I embed the title set into the PS1? |
#5
|
|||
|
|||
Hi cbeck,
Thanks for the information. At this point, I would suggest using the Xterm emulation for your first connection without making any other changes. This should allow you to see the behavior you want when exiting the second connection. The VT### or Xterm emulations are more for general use. Is there some specific reason that you are using the Linux emulation? Do you see the behavior you want if you change your emulation to Xterm, disconnect and reconnect? |
#6
|
|||
|
|||
Well, Xterm looses all of the colouring that was working in my previous setup.
My PS1 is: export PS1="\[\033[1;30m\][\[\033[0;34m\]\u\[\033[1;30m\]@\[\033[0;35m\]\h\[\033[1;30m\]] \[\033[0;30m\]\w \[\033[1;30m\]\$\[\033[0m\] " Can you offer advice on how to translate that into something Xterm friendly? In addition, it doesn't seem to work - logging out of the remote ssh connection doesn't reset the tab or window title bar. Cheers, Chris |
#7
|
|||
|
|||
Ah - when first chosing Xterm the colour box wasn't selectable but now it is - so the colours are working. But the title/tab still isn't.
Cheers, Chris |
#8
|
|||
|
|||
Hi Chris,
I am glad to hear that you got the color working. Did you disconnect and reconnect your session after changing the emulation to Xterm? If you did, have you configured Terminal type: to be something other than Xterm? This option is located in the Terminal / Emulation / Advanced category of the Session Options dialog. When you run the test, if it is still failing after disconnecting and reconnecting the session, what is the value of the TERM environment variable? |
#9
|
|||
|
|||
Hi Todd,
Thanks for sticking with this. To answer your questions: 1) I closed the program and restarted it. 2) The terminal types list is empty and the checkbox isn't checked. 3) My TERM variable is xterm-color on the first machine, on the second, and on the first after I exit the second. Both servers are running CentOS 5.6, if that makes a difference. Cheers, Chris |
#10
|
|||
|
|||
No problem Chris. I have not been able to reproduce the failure in my environment using your PS1 and PROMPT_COMMAND variables, so it looks like there is something in your environment that is preventing this default behavior from working as expected. Here is a list of steps that should be able to be used to get the behavior one expects when connecting to a remote using Bash as the shell and Xterm as the emulation:
If that doesn't help, then there is something else in your remote environment that is preventing the shell from functioning as one would expect. Does this information help? As a note, the Linux emulation is basically VT220 with a few modifications to aid in running Console applications. A Console application is one that would normally be run at the console, like setup. Last edited by jdev; 09-16-2011 at 05:20 PM. |
#11
|
|||
|
|||
Hi Todd,
I'm not using any PROMPT_COMMAND settings, just echo -ne and export PS1= echo $PROMPT_COMMAND from the command line comes back empty. On the remote site when I remove my own .bashrc and include the system default explicitly (it doesn't get loaded otherwise) I do have a PROMPT_COMMAND PROMPT_COMMAND='history -a ; echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"' but it still doesn't set the title. Do I need to have a PROMPT_COMMAND on the first system for this to work? Cheers, Chris |
#12
|
|||
|
|||
Cbeck - you'll want to place your escape sequences all in the PS1 prompt, not in an echo line. This way, the prompt and screen title are changed at the same time, and will remain correct.
See a more complex example I posted some time ago that shows how to configure your prompt and titles. Post #6: http://forums.vandyke.com/showthread.php?t=3639 The bulk of this setup was to make customizing your prompt easier and make the setup portable to other terminal environments. The key to making the prompt work correctly (e.g. for command line editing) when it contains non-printable characters is to let bash (or tcsh) know about the portions of the prompt that are not printable. Otherwise, it incorrectly paints some lines during edit mode. I'll be happy to answer questions you may have. |
#13
|
|||
|
|||
Hi Todd, MrC
Yep, adding it to the PROMPT_COMMAND solved the problem. Cheers! |
![]() |
Thread Tools | |
Display Modes | |
|
|