本文整理汇总了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);
}));
}