-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126383 from microsoft/merogge/terminalEditor_tyriar
Terminal editor lifecycle work
- Loading branch information
Showing
11 changed files
with
141 additions
and
58 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
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
33 changes: 33 additions & 0 deletions
33
src/vs/workbench/contrib/terminal/browser/terminalEditorService.ts
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,33 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { ITerminalEditorService, ITerminalInstance, TerminalTarget } from 'vs/workbench/contrib/terminal/browser/terminal'; | ||
import { TerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorInput'; | ||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; | ||
|
||
export class TerminalEditorService implements ITerminalEditorService { | ||
declare _serviceBrand: undefined; | ||
|
||
terminalEditorInstances: ITerminalInstance[] = []; | ||
|
||
private _editorInputs: Map</*instanceId*/number, TerminalEditorInput> = new Map(); | ||
|
||
constructor( | ||
@IEditorService private readonly _editorService: IEditorService | ||
) { | ||
// TODO: Multiplex instance events | ||
} | ||
|
||
async createEditor(instance: ITerminalInstance): Promise<void> { | ||
instance.target = TerminalTarget.Editor; | ||
const input = new TerminalEditorInput(instance); | ||
this._editorInputs.set(instance.instanceId, input); | ||
await this._editorService.openEditor(input, { | ||
pinned: true, | ||
forceReload: true | ||
}); | ||
this.terminalEditorInstances.push(instance); | ||
} | ||
} |
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.