/
xsh.Session

xsh.Session

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.

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.)

Array

GetArgumentList()

 

Retrieves the parameters specified when executing the script.

In JS scripts, the values ​​are stored in an array variable via new VBArray(xsh.Session.GetArgumentList()).toArray()

Number

GetArgumentCount()

 

Retrieves the number of parameters specified when executing the script.

 

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.

 

Related content

Open Beta 8 New Features
Open Beta 8 New Features
Read with this
xsh.Session
xsh.Session
More like this
xsh.Session
More like this
xsh.Session
xsh.Session
More like this
VBS 예제: 스크롤백 버퍼 지우고 일련의 명령 결과를 파일에 기록
VBS 예제: 스크롤백 버퍼 지우고 일련의 명령 결과를 파일에 기록
More like this
script api problem [1]
script api problem [1]
More like this