本文整理匯總了TypeScript中vscode.window.onDidCloseTerminal方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript window.onDidCloseTerminal方法的具體用法?TypeScript window.onDidCloseTerminal怎麽用?TypeScript window.onDidCloseTerminal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vscode.window
的用法示例。
在下文中一共展示了window.onDidCloseTerminal方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: activate
export function activate(context: vscode.ExtensionContext) {
const codeManager = new CodeManager();
vscode.window.onDidCloseTerminal(() => {
codeManager.onDidCloseTerminal();
});
const run = vscode.commands.registerCommand("code-runner.run", (fileUri: vscode.Uri) => {
codeManager.run(null, fileUri);
});
const runCustomCommand = vscode.commands.registerCommand("code-runner.runCustomCommand", () => {
codeManager.runCustomCommand();
});
const runByLanguage = vscode.commands.registerCommand("code-runner.runByLanguage", () => {
codeManager.runByLanguage();
});
const stop = vscode.commands.registerCommand("code-runner.stop", () => {
codeManager.stop();
});
context.subscriptions.push(run);
context.subscriptions.push(runCustomCommand);
context.subscriptions.push(runByLanguage);
context.subscriptions.push(stop);
context.subscriptions.push(codeManager);
}
示例2: test
test('terminal, onDidCloseTerminal event fires when terminal is disposed', (done) => {
const terminal = window.createTerminal();
window.onDidCloseTerminal((eventTerminal) => {
assert.equal(terminal, eventTerminal);
done();
});
terminal.dispose();
});
示例3:
const reg2 = renderer.onDidAcceptInput(data => {
assert.equal(data, 'bar');
reg2.dispose();
const reg3 = window.onDidCloseTerminal(() => {
reg3.dispose();
done();
});
terminal.dispose();
});
示例4: constructor
constructor(ip: string) {
this.interpreterPath = ip;
vscode.window.onDidCloseTerminal((closedTerminal: vscode.Terminal) => {
if (this.terminal === closedTerminal) {
this.terminal = undefined;
}
});
}
示例5: activateExecInTerminalProvider
export function activateExecInTerminalProvider(): vscode.Disposable[] {
const disposables: vscode.Disposable[] = [];
disposables.push(vscode.commands.registerCommand(Commands.Exec_In_Terminal, execInTerminal));
disposables.push(vscode.commands.registerCommand(Commands.Exec_Selection_In_Terminal, execSelectionInTerminal));
disposables.push(vscode.window.onDidCloseTerminal((closedTermina: vscode.Terminal) => {
if (terminal === closedTermina) {
terminal = null;
}
}));
return disposables;
}
示例6: constructor
public constructor(
context: ExtensionContext,
configuration: Configuration,
shellProviderManager: ShellProviderManager
) {
this._configuration = configuration;
this._shellProvider = shellProviderManager;
context.subscriptions.push(
window.onDidCloseTerminal(closedTerminal => {
if (closedTerminal === this._runningTerminal) {
this._runningTerminal = undefined;
}
})
);
}
示例7: activate
export function activate(context: vscode.ExtensionContext) {
const dotnetTestExplorer = new DotnetTestExplorer(context);
vscode.window.registerTreeDataProvider("dotnetTestExplorer", dotnetTestExplorer);
AppInsightsClient.sendEvent("loadExtension");
context.subscriptions.push(vscode.commands.registerCommand("dotnet-test-explorer.refreshTestExplorer", () => {
dotnetTestExplorer.refreshTestExplorer();
}));
context.subscriptions.push(vscode.commands.registerCommand("dotnet-test-explorer.runAllTests", () => {
dotnetTestExplorer.runAllTests();
}));
context.subscriptions.push(vscode.commands.registerCommand("dotnet-test-explorer.runTest", (test) => {
dotnetTestExplorer.runTest(test.label);
}));
context.subscriptions.push(vscode.window.onDidCloseTerminal((closedTerminal: vscode.Terminal) => {
Executor.onDidCloseTerminal(closedTerminal);
}));
}