Class: Term

vertx-shell-js/term~ Term

new Term()

The terminal.
Source:

Methods

close()

Close the connection to terminal.
Source:

closeHandler(handler) → {Term}

Set a handler that will be called when the terminal is closed.
Parameters:
Name Type Description
handler function the handler
Source:
Returns:
a reference to this, so the API can be used fluently
Type
Term

echo(text) → {Term}

Echo some text in the terminal, escaped if necessary.

Parameters:
Name Type Description
text string the text to echo
Source:
Returns:
a reference to this, so the API can be used fluently
Type
Term

height() → {number}

Source:
Returns:
the current height, i.e the number of columns or if unknown
Type
number

interruptHandler(handler) → {Term}

Set an interrupt signal handler on the term.
Parameters:
Name Type Description
handler SignalHandler the interrupt handler
Source:
Returns:
a reference to this, so the API can be used fluently
Type
Term

lastAccessedTime() → {number}

Source:
Returns:
the last time this term received input
Type
number

readline(prompt, lineHandler, completionHandler)

Prompt the user a line of text, providing a completion handler to handle user's completion.
Parameters:
Name Type Description
prompt string the displayed prompt
lineHandler function the line handler called with the line
completionHandler function the completion handler
Source:

resizehandler(handler) → {Term}

Parameters:
Name Type Description
handler function
Source:
Returns:
Type
Term

setSession(session) → {Term}

Associate the term with a session.
Parameters:
Name Type Description
session Session the session to set
Source:
Returns:
a reference to this, so the API can be used fluently
Type
Term

stdinHandler(handler) → {Term}

Parameters:
Name Type Description
handler function
Source:
Returns:
Type
Term

suspendHandler(handler) → {Term}

Set a suspend signal handler on the term.
Parameters:
Name Type Description
handler SignalHandler the suspend handler
Source:
Returns:
a reference to this, so the API can be used fluently
Type
Term

type() → {string}

Source:
Returns:
the declared tty type, for instance , , etc... it can be null when the tty does not have declared its type.
Type
string

width() → {number}

Source:
Returns:
the current width, i.e the number of rows or if unknown
Type
number

write(data) → {Term}

Parameters:
Name Type Description
data string
Source:
Returns:
Type
Term