VanDyke Software Forums

VanDyke Software Forums (
-   General (
-   -   Tabname (

pfistyle 03-23-2020 08:26 AM


Sorry to open a thread, but I'm desperate. I really checked for hours for a solution to my problem. If there is THE existing thread, which could bring me to my solution, please just paste me the link... Read several, got no working solution.

Situation: I connect over sessions to linux jumphosts, from there to network devices (mostly cisco routers).

I would like the to have the tab name to be set to the actual hostname of the device I am connected to.

How can this be done as easy as possible? Thank you for any help.

bgagnon 03-23-2020 08:57 AM

Hi pfistyle,

It's likely the info is in several threads, but it's easier just to cover it again than to find it. (One of the reasons we prefer you just contact instead of using forums.) :)

First, though, have you considered using the alternate way of connecting through jump hosts implemented in v7.1

Changes in SecureCRT 7.1 (Beta 1) -- February 26, 2013

New features:

  • Added support for dependent sessions so that a connection can be made to a jump host or SSH gateway before the session is connected.
That way your "end host" tab always will have the session name you have designated.

pfistyle 03-23-2020 09:14 AM

Hi Brenda,

Thank you for your help.

I don't think that option would fit for me. I need to be able to work on the jumphost and sometimes connect to another host (router). As soon as I connect, I would the tabname to be the same as the hostname of the device I'm logged in on...

Normally I have several tabs open and would like to know, if they are connected to the jumphost or any other device.

bgagnon 03-23-2020 09:29 AM

1 Attachment(s)
Hi pfistyle,

No worries, that is the case on occasion unfortunately.

Are you on Windows or Mac?

I think the attached script is the best solution but presently it is VBScript only.

It does require you configure it as a logon script so that it is "always ready" for when you might "ssh host". See the comments in the script.

If that won't fit your environment, let me know. There might be another solution.

pfistyle 03-23-2020 09:45 AM

Hey Brenda,

It works almost perfectly, thank you.

The only problem is, that when I log out of a host and connect to another, the tab name stays the same as the hostname of the device I connected to first.

Is there a solution for this problem?


bgagnon 03-23-2020 09:49 AM

Hi pfistyle,

Please describe how you are doing this (in detail):

...that when I log out of a host and connect to another...

pfistyle 03-23-2020 09:52 AM


I am logged into a linux jumphost.

Then I connect to a router (A) --> the tab name is changed to it's hostname

Then I exit the router

Then I connect to another router (B) --> the tab name stays router A's hostname

Thank you.

bgagnon 03-23-2020 10:00 AM

Hi pfistyle,

How do you connect to router (A)? Do you type "ssh routerA"?

How do you exit the router? Do you type "exit"?

How do you connect to router (B)?

pfistyle 03-23-2020 10:02 AM

Hi Brenda,

I do a ssh or telnet to router A

I do an "exit" to log out router A

I do a ssh or telnet to router B


bgagnon 03-23-2020 10:38 AM

Hi pfistyle,

Does the jump host shell prompt match router B's?

That's the one caveat to using this script. The jump host's shell prompt must be different and unique from any other shell prompt in order for the script to work properly. That's how it detects you have exited a session with a host.

Can you change your prompt on the jump host?

pfistyle 03-24-2020 12:15 AM

Hi Brenda,

I log in/out like this:

me@linux:~$ t router1
Connected to router1

This system is for the use of authorized users only.

Username: me

Connection closed by foreign host.
me@linux:~$ t router2
Connected to router2

This system is for the use of authorized users only.

Username: me

Connection closed by foreign host.

After connecting to router1, the tab name stays router1...

Thank you!

bgagnon 03-24-2020 07:59 AM

Hi pfistyle,

Change line 40 in the script to accommodate your $ prompt.



        strText = objTab.Screen.ReadString("#", ">", 5)


        strText = objTab.Screen.ReadString("#", ">", "$", 5)

pfistyle 03-24-2020 08:43 AM

Hi Brenda,

Thx, but this does not help. Now the tabname stays always the name of the jumphost I connect to initially.

Thank you!

bgagnon 03-24-2020 09:32 AM

Hi pfistyle,

Is Cancel available from the Script menu?

If so, if you select it, what is the error message?

bgagnon 03-24-2020 11:43 AM

1 Attachment(s)
Hi pfistyle,

I misunderstood the execution of the script, I thought it was designed to run until cancelled, but that is not the case.

Try the new attached one.

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