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
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
write(data) → {Term}
Parameters:
Name | Type | Description |
---|---|---|
data |
string |
- Source:
Returns:
- Type
- Term