當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript window.onDidCloseTerminal方法代碼示例

本文整理匯總了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);
}
開發者ID:formulahendry,項目名稱:vscode-code-runner,代碼行數:30,代碼來源:extension.ts

示例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();
	});
開發者ID:sandy081,項目名稱:vscode,代碼行數:8,代碼來源:window.test.ts

示例3:

				const reg2 = renderer.onDidAcceptInput(data => {
					assert.equal(data, 'bar');
					reg2.dispose();
					const reg3 = window.onDidCloseTerminal(() => {
						reg3.dispose();
						done();
					});
					terminal.dispose();
				});
開發者ID:joelday,項目名稱:vscode,代碼行數:9,代碼來源:window.test.ts

示例4: constructor

    constructor(ip: string) {
        this.interpreterPath = ip;

        vscode.window.onDidCloseTerminal((closedTerminal: vscode.Terminal) => {
            if (this.terminal === closedTerminal) {
                this.terminal = undefined;
            }
        });
    }
開發者ID:karthiknadig,項目名稱:RTVS,代碼行數:9,代碼來源:replTerminal.ts

示例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;
}
開發者ID:walkoncross,項目名稱:pythonVSCode,代碼行數:11,代碼來源:execInTerminalProvider.ts

示例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;
             }
         })
     );
 }
開發者ID:KalitaAlexey,項目名稱:RustyCode,代碼行數:15,代碼來源:terminal_task_manager.ts

示例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);
    }));
}
開發者ID:felix-b,項目名稱:vscode-dotnet-test-explorer,代碼行數:21,代碼來源:extension.ts


注:本文中的vscode.window.onDidCloseTerminal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。