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 25, 2018
1 parent ed44327 commit 5b0fe0c
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 @@ -2170,7 +2170,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 5b0fe0c

Please sign in to comment.