Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Secure Shell

Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2009, 08:35 AM
GKnight GKnight is offline
Registered User
 
Join Date: May 2008
Posts: 26
tabs renamed automatically?

Something's been bugging me for a while. I've been suing SecureCRT 5.5 and when I connect to some linux servers, the tab name automatically changes to the command prompt. This sometimes gets really annoying as I may have long current directory names and the tabs get too wide and start pushing other tabs off the screen. Is there a way to turn this off?

Last edited by GKnight; 09-12-2009 at 08:39 AM.
Reply With Quote
  #2  
Old 09-12-2009, 10:17 AM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,040
The server is sending window title change requests. That's the real cause of the problem. You could disable that by setting your prompt in one of your initialization files (.bash_profile, .tcshrc, etc.).

SecureCRT does provide an option to ignore the window title change requests. If you enable the option to Ignore window title change requests in Session Options / Terminal / Emulation / Advanced, does that fix the problem?
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #3  
Old 09-19-2009, 10:34 AM
GKnight GKnight is offline
Registered User
 
Join Date: May 2008
Posts: 26
Quote:
Originally Posted by miked
SecureCRT does provide an option to ignore the window title change requests. If you enable the option to Ignore window title change requests in Session Options / Terminal / Emulation / Advanced, does that fix the problem?
Thanks! That setting did the trick. No more annoying tab name changes!

What exactly triggers the window title change? Some of my linux servers do it while some don't, I can't quite figure it out by looking at the profiles or env settings. It's only happening on the linux servers.
Reply With Quote
  #4  
Old 09-19-2009, 04:07 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 998
Quote:
Originally Posted by GKnight
What exactly triggers the window title change? Some of my linux servers do it while some don't, I can't quite figure it out by looking at the profiles or env settings. It's only happening on the linux servers.
When SecureCRT receives the following escape sequence, it changes the window title:
ESC]2;titleBEL
(By BEL, I mean ASCII(7)).

What's likely happening is that the shell prompt on your Linux machines is configured to send the escape sequence as part of displaying the command prompt. If you're running a bash shell on your Linux machines, it's likely that either the PS1 or PROMPT_COMMAND environment variables are responsible for sending the window title change request to SecureCRT.

You can play around with this if you want to experiment. For example, you might want to set up your remote startup scripts to always set the tab title to the remote hostname to which you are connected. Here's an example command you can run to change your window prompt (assuming the Session option to Ignore window title change requests is not enabled):
echo -ne "\033]2;This is my new window Title\007"
To set your prompt to the hostname of the Linux machine to which you are connected, you might use the following as an example:
echo -ne "\033]2;`hostname`\007"
Or, to set your prompt to the IP address of the Linux machine to which you are connected, you could use the following command:
echo -ne "\033]2;`ifconfig eth0 | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`\007"

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #5  
Old 10-19-2009, 10:17 AM
GKnight GKnight is offline
Registered User
 
Join Date: May 2008
Posts: 26
Thanks for the detailed explanation! I checked, and sure enough, I found this in the /etc/bashrc file:

Code:
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
No big deal anymore as I enabled the "ignore the title change" option. But good to know for the future, in case I need some servers to set the tab name.
Reply With Quote
  #6  
Old 07-15-2014, 10:00 AM
adudek adudek is offline
Registered User
 
Join Date: Mar 2005
Posts: 54
how do do this in other shells?

I noticed that the cmds you gave only work on bash.
what about tcsh, csh, or zsh?

Thanks
Reply With Quote
  #7  
Old 07-15-2014, 01:46 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 998
Quote:
Originally Posted by adudek View Post
I noticed that the cmds you gave only work on bash.
what about tcsh, csh, or zsh?
As I think back to where I was 4+ years ago, I don't think it was my intention to provide comprehensive examples for other shells. I'm most comfortable in sh/bash, and use it rather than tcsh/csh/zsh wherever possible. The post was designed to explain why the title might have been changing and give a related example or two.

What problem are you trying to solve, Aaron?

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:23 AM.