Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only run selected texts in a user terminal #7453

Merged
merged 1 commit into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/task/src/browser/task-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,8 @@ export class TaskService implements TaskConfigurationClient {
selectedRange = Range.create(startLine, 0, endLine + 1, 0);
}
const selectedText: string = this.editorManager.currentEditor.editor.document.getText(selectedRange).trimRight() + '\n';
let terminal = this.terminalService.currentTerminal;
if (!terminal) {
let terminal = this.terminalService.lastUsedTerminal;
if (!terminal || terminal.kind !== 'user' || (await terminal.hasChildProcesses())) {
akosyakov marked this conversation as resolved.
Show resolved Hide resolved
terminal = <TerminalWidget>await this.terminalService.newTerminal(<TerminalWidgetFactoryOptions>{ created: new Date().toString() });
await terminal.start();
this.terminalService.activateTerminal(terminal);
Expand Down