-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release: 0.1.7
- Loading branch information
Showing
98 changed files
with
827 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as vscode from 'vscode'; | ||
import { Terminal, TerminalOptions } from 'vscode'; | ||
import { ITerminalMap } from '../types'; | ||
|
||
export default function executeCommand(terminalMapping: ITerminalMap, script: vscode.Command, id?: string) { | ||
if (!script.arguments) { | ||
return; | ||
} | ||
const args = script.arguments; | ||
const [cwd, command] = args; | ||
if (!command) { | ||
return; | ||
} | ||
|
||
const terminalId = id || command; | ||
let terminal: Terminal; | ||
|
||
if (terminalMapping.has(terminalId)) { | ||
terminal = terminalMapping.get(terminalId)!; | ||
} else { | ||
const terminalOptions: TerminalOptions = { cwd, name: command }; | ||
terminal = vscode.window.createTerminal(terminalOptions); | ||
terminalMapping.set(terminalId, terminal); | ||
} | ||
|
||
terminal.show(); | ||
terminal.sendText(command); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ITerminalMap } from '../types'; | ||
|
||
export default function stopCommand(terminalMapping: ITerminalMap, scriptId: string) { | ||
const currentTerminal = terminalMapping.get(scriptId); | ||
if (currentTerminal) { | ||
currentTerminal.dispose(); | ||
terminalMapping.delete(scriptId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.