Skip to content

Commit

Permalink
Terminal Plugin API: by default, add a new line to the text being sen…
Browse files Browse the repository at this point in the history
…t to the terminal.

Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>
  • Loading branch information
azatsarynnyy committed Oct 24, 2018
1 parent 233802d commit b02982b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## v0.3.16
- [plug-in] added `DocumentLinkProvider` Plug-in API
- [plug-in] Terminal.sendText API adds a new line to the text being sent to the terminal if `addNewLine` parameter wasn't specified


## v0.3.15
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/plugin/terminal-ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class TerminalExtImpl implements Terminal {
this.termProcessId = this.proxy.$createTerminal(nameOrOptions);
}

sendText(text: string, addNewLine?: boolean): void {
sendText(text: string, addNewLine: boolean = true): void {
this.termProcessId.then(id => this.proxy.$sendText(id, text, addNewLine));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,7 @@ declare module '@theia/plugin' {
/**
* Send text to the terminal.
* @param text - text content.
* @param addNewLine - in case true - apply new line after the text, otherwise don't apply new line.
* @param addNewLine - in case true - apply new line after the text, otherwise don't apply new line. This defaults to `true`.
*/
sendText(text: string, addNewLine?: boolean): void;

Expand Down

0 comments on commit b02982b

Please sign in to comment.