Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following functions and variables can be used in Xshell sessions. To use these functions and variables, execute them together with xsh.Session. For example, to use 'Sleep()' function, use 'xsh.Session.Sleep(1000)'.

Functions




Return Value

Function

Parameter

Description

Void

Open(LPCTSTR lpszSession)

lpszSession
A character string of an Xshell session path or URL format of Xshell.

Open a new session or URL.
To open a session, place /s option in front of a character string.
Ex.) To open the A.xsh session, use '/s $PATH/A.xsh'.

Void

Close()


Close the currently connected session.

Void

Sleep(long timeout)

Timeout
Milisecond unit time value.

Make Xshell wait for the designated time.

Void

LogFilePath(LPCTSTR lpszNewFilePath)

lpszNewFilePath
File name including path

Designate log file.

void

StartLog()


Start logging for a session. Log is designated with a path specified in LogFilePath(). If a log file path is not designated, the default path is used.

void

StopLog()


Stop logging.

BOOL

IsUtf8()


Check if the current terminal encoding is UTF-8

BOOL

SelectTabName()


Specifies a tab in which to apply the script. (This feature is only supported in Single Process Mode.)

...

Variable



Name

Type

Description

Connected

BOOL

Check whether current session is connected.

LocalAddress

BSTR

Retrieve the local address.

Path

BSTR

Retrieve the current session file path.

RemoteAddress

BSTR

Retrieve the remote address.

RemotePort

long

Retrieve the remote port.

Logging

BOOL

Check whether current session is recording log file.

LogFilePath

BSTR

​​Save as a log file.​

TabText

BSTR

Retrieve the current tab name or change it.

SessionName

BSTR

Retrieve the current tab's session name. 

UserName

BSTR

Retrieve the current session's user name.

Description

BSTR

Retrieve the current session's Description.

ScriptFolderPath

BSTR

Retrieve the current session's script folder path.