Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added
system.run
andsystem.execute
commands to the system plugin.system.run(Command)
: Promise: It runs the command then returns a PtyResponse or throws a PtyErrorsystem.execute(Command)
: Promise: It runs the command but dosen’t wait for the output or any error thrown.Added
pty
module and export toacode
The
pty.host.run
function takes theRunCommand
type as argumentExample Usage
System Run
Read this (TERMUX.RUN_COMMAND) for more info on
sessionAction
and other argumentsUsing Acode PTY
You should use this for spawning and interacting with processes
Type Interface
Command
command
: String: Represent the command to be executedargs
: Array: Arguments to be passed to the commandbackground
: Boolean: Specify whether to run the command in the background as a taskhomeDir
: String: Path where the command should be executed fromPtyResponse
stderr
: Stringstdout
: StringexitCode
: NumberstderrLength
: NumberstdoutLength
: NumberPtyError
error
: StringerrorCode
: NumberexitCode
: NumberRunCommand
command
: String: Represent the command to be executedtype
: String: Specify connection type, should be eitherpty
(pseudo terminal mode) orprocess
(simply execute the command and relay putputs)args
: Array: Arguments to be passed to the commandonmessage
: Function(data): void : Specify function to be called when a message comes throughautoReconnect
: Boolean: Auto reconnect to server in case of disconnection?reconnectDelay
: Number: How long to wait before attempting to reconnectmaxRetries
: Number: How many times to try to reconnect before giving up