View Single Post
Old 05-27-2021, 11:04 AM
gregg gregg is offline
Registered User
Join Date: Oct 2010
Posts: 75
Allow % variables in more places


The variables available in some places like log file naming (%H=hostname, %S=session name, etc, etc) would be nice to have in other locations.

1. Local Shell; but first this needs to also allow passing command line parameters.

2. Logon Actions; expect (nice-to-have) and send (what i'm really interested in)

My reason: I'm trying to hack in mosh usage. With Win10 and WSL, you can set your local shell to bash.exe, and bash.exe supports "-c" which allows starting another app, aka:

C:\Windows\System32\bash.exe -c /usr/bin/mosh <hostname>

Ideally, <hostname> would be %H in this case. But putting any cli arguments in the Connection->Local Shell path causes SecureCRT to say "Local shell path is not a console application"

Ok, so abandoning that, I tried a Logon action.
Expect: <nothing/empty>
Send: /usr/bin/mosh %H

%H is sent as a literal and not the hostname.

Unfortunately, I do realize just adding %H support here directly is bad because it would break any existing logon actions that are already using % in this functionality and would require something like a checkbox (defaulted off) that said "variable expansion enable" - but that's an implementation detail to which I don't know the full ramifications of.

Also of note, I've been enjoying the latest 9.0.2 version. Thank you!

Last edited by gregg; 05-27-2021 at 11:27 AM. Reason: grammar, clarity
Reply With Quote