Xshell is yet another putty-like terminal client for windows that features a couple of nice extensions. See the net for a multitude of alike “top-10 terminal clients for windows” posts. Among the features, Xshell does not only provide a raw terminal pane but also runs a so called local shell that actually embeds remote shells. In other words, initially (standard configuration) you get your xshell window, running the Xshell shell and offering a number of internal commands to act in the realm of Xshell by means of simple keystrokes. If you’re addicted to the keyboard, like me, this is a very pleasent way to go. For example, see the help
output, a list
of available sessions (connect profiles already configured) and an open
to eventually connect to the remote host:
Anything keyed and, by the way, the session name even tab-expanded after a few characters. Cool, right?
Ok, that much for the preface, important to understand what followes next, the forwarding of a dedicated environment setting, namely TERM=xterm-256color
with this terminal client (see why e.g.: https://fedoraproject.org/wiki/Features/256_Color_Terminals#Caveats, see others e.g.: https://codeyarns.github.io/tech/2015-03-18-how-to-set-term-to-xterm-256color.html).
The point is, based on the local shell, Xshell is able to inject/communicate code the the remote shell in an after-login but pre-(final-)prompt fashion. All you need to do is to code a snippet to call some member functions of the current local shell Screen
object. Three language binding are possible so far: js, py and vbs. Examples are given in AppData\Local\NetSarang Computer\6\Xshell\Scripts\ScriptSample
, documentation resides as https://netsarang.atlassian.net/wiki/spaces/ENSUP/pages/135136512/Using+Scripts . In order to achive the forward, the following code is sufficient (don’t ask my why a sleep is needed here):
def Main(): xsh.Screen.Synchronous = True # True or False xsh.Screen.Send("export TERM=xterm-256color\r") xsh.Session.Sleep(1000)
The file location can be configured in the sessions connect profile dialog like so. Done!
After all, the tiled and full screen view modes are also worth a try. Like it.
Enjoy
You must be logged in to post a comment.