diff options
author | Daniel Imms <2193314+Tyriar@users.noreply.github.com> | 2022-07-19 19:28:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-19 19:28:34 +0300 |
commit | 650e4b5e68d22d111ed22e571c274ddf48faa96a (patch) | |
tree | fc9e57360e9f3315cf9b4d49f91e5a1a9226e743 /src | |
parent | 159a10972672fe6e3c874d0ee61741959a2b4f35 (diff) | |
parent | becd1f58bcb464277ee3b3c1c38df68e61c97767 (diff) |
Merge pull request #155627 from microsoft/tyriar/153570
Fix shell integration left padding on splits and editors
Diffstat (limited to 'src')
-rw-r--r-- | src/vs/workbench/contrib/terminal/browser/terminalView.ts | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/vs/workbench/contrib/terminal/browser/terminalView.ts b/src/vs/workbench/contrib/terminal/browser/terminalView.ts index bb3b8225a5f..4b2212066f1 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalView.ts @@ -112,11 +112,11 @@ export class TerminalViewPane extends ViewPane { this._terminalTabbedView?.rerenderTabs(); } })); - _configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationsEnabled) || e.affectsConfiguration(TerminalSettingId.ShellIntegrationEnabled)) { - this._updateForShellIntegration(); + this._register(this._configurationService.onDidChangeConfiguration(e => { + if (this._parentDomElement && (e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationsEnabled) || e.affectsConfiguration(TerminalSettingId.ShellIntegrationEnabled))) { + this._updateForShellIntegration(this._parentDomElement); } - }); + })); this._register(this._terminalService.onDidCreateInstance((i) => { i.capabilities.onDidAddCapability(c => { if (c === TerminalCapability.CommandDetection && !this._gutterDecorationsEnabled()) { @@ -124,15 +124,10 @@ export class TerminalViewPane extends ViewPane { } }); })); - this._updateForShellIntegration(); } - private _updateForShellIntegration() { - if (this._gutterDecorationsEnabled()) { - this._parentDomElement?.classList.add('shell-integration'); - } else { - this._parentDomElement?.classList.remove('shell-integration'); - } + private _updateForShellIntegration(container: HTMLElement) { + container.classList.toggle('shell-integration', this._gutterDecorationsEnabled()); } private _gutterDecorationsEnabled(): boolean { @@ -143,6 +138,9 @@ export class TerminalViewPane extends ViewPane { override renderBody(container: HTMLElement): void { super.renderBody(container); + if (!this._parentDomElement) { + this._updateForShellIntegration(container); + } this._parentDomElement = container; this._parentDomElement.classList.add('integrated-terminal'); this._fontStyleElement = document.createElement('style'); |