@@ -13,13 +13,7 @@ import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/term
13
13
import { DisposableStore } from 'vs/base/common/lifecycle' ;
14
14
import { IEditorOptions } from 'vs/editor/common/config/editorOptions' ;
15
15
import { TerminalLocation , TerminalSettingId } from 'vs/platform/terminal/common/terminal' ;
16
- import { IColorTheme , IThemeService } from 'vs/platform/theme/common/themeService' ;
17
- import { IViewDescriptorService , ViewContainerLocation } from 'vs/workbench/common/views' ;
18
- import { editorBackground } from 'vs/platform/theme/common/colorRegistry' ;
19
- import { ansiColorIdentifiers , TERMINAL_BACKGROUND_COLOR , TERMINAL_CURSOR_BACKGROUND_COLOR , TERMINAL_CURSOR_FOREGROUND_COLOR , TERMINAL_FOREGROUND_COLOR , TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry' ;
20
16
import { ICommandTracker , ITerminalFont , TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal' ;
21
- import { PANEL_BACKGROUND , SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme' ;
22
- import { Color } from 'vs/base/common/color' ;
23
17
import { isSafari } from 'vs/base/browser/browser' ;
24
18
import { IXtermTerminal } from 'vs/workbench/contrib/terminal/browser/terminal' ;
25
19
import { ILogService } from 'vs/platform/log/common/log' ;
@@ -28,6 +22,12 @@ import { TerminalStorageKeys } from 'vs/workbench/contrib/terminal/common/termin
28
22
import { INotificationService , IPromptChoice , Severity } from 'vs/platform/notification/common/notification' ;
29
23
import { CommandTrackerAddon } from 'vs/workbench/contrib/terminal/browser/xterm/commandTrackerAddon' ;
30
24
import { localize } from 'vs/nls' ;
25
+ import { IColorTheme , IThemeService } from 'vs/platform/theme/common/themeService' ;
26
+ import { IViewDescriptorService , ViewContainerLocation } from 'vs/workbench/common/views' ;
27
+ import { editorBackground } from 'vs/platform/theme/common/colorRegistry' ;
28
+ import { PANEL_BACKGROUND , SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme' ;
29
+ import { TERMINAL_FOREGROUND_COLOR , TERMINAL_BACKGROUND_COLOR , TERMINAL_CURSOR_FOREGROUND_COLOR , TERMINAL_CURSOR_BACKGROUND_COLOR , TERMINAL_SELECTION_BACKGROUND_COLOR , ansiColorIdentifiers } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry' ;
30
+ import { Color } from 'vs/base/common/color' ;
31
31
32
32
// How long in milliseconds should an average frame take to render for a notification to appear
33
33
// which suggests the fallback DOM-based renderer
@@ -45,7 +45,6 @@ let WebglAddon: typeof WebglAddonType;
45
45
export class XtermTerminal extends DisposableStore implements IXtermTerminal {
46
46
/** The raw xterm.js instance */
47
47
readonly raw : RawXtermTerminal ;
48
- target ?: TerminalLocation ;
49
48
50
49
private _core : IXtermCore ;
51
50
private static _suggestedRendererType : 'canvas' | 'dom' | undefined = undefined ;
@@ -63,6 +62,12 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
63
62
64
63
get commandTracker ( ) : ICommandTracker { return this . _commandTrackerAddon ; }
65
64
65
+ private _target : TerminalLocation | undefined ;
66
+ set target ( location : TerminalLocation | undefined ) {
67
+ this . _target = location ;
68
+ }
69
+ get target ( ) : TerminalLocation | undefined { return this . _target ; }
70
+
66
71
/**
67
72
* @param xtermCtor The xterm.js constructor, this is passed in so it can be fetched lazily
68
73
* outside of this class such that {@link raw} is not nullable.
@@ -72,6 +77,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
72
77
private readonly _configHelper : TerminalConfigHelper ,
73
78
cols : number ,
74
79
rows : number ,
80
+ location : TerminalLocation ,
75
81
@IConfigurationService private readonly _configurationService : IConfigurationService ,
76
82
@ILogService private readonly _logService : ILogService ,
77
83
@INotificationService private readonly _notificationService : INotificationService ,
@@ -80,7 +86,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
80
86
@IViewDescriptorService private readonly _viewDescriptorService : IViewDescriptorService
81
87
) {
82
88
super ( ) ;
83
-
89
+ this . target = location ;
84
90
const font = this . _configHelper . getFont ( undefined , true ) ;
85
91
const config = this . _configHelper . config ;
86
92
const editorOptions = this . _configurationService . getValue < IEditorOptions > ( 'editor' ) ;
@@ -125,6 +131,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
125
131
this . _updateUnicodeVersion ( ) ;
126
132
}
127
133
} ) ) ;
134
+
128
135
this . add ( this . _themeService . onDidColorThemeChange ( theme => this . _updateTheme ( theme ) ) ) ;
129
136
this . add ( this . _viewDescriptorService . onDidChangeLocation ( ( { views } ) => {
130
137
if ( views . some ( v => v . id === TERMINAL_VIEW_ID ) ) {
@@ -133,7 +140,6 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
133
140
} ) ) ;
134
141
135
142
// Load addons
136
-
137
143
this . _updateUnicodeVersion ( ) ;
138
144
139
145
this . _commandTrackerAddon = new CommandTrackerAddon ( ) ;
@@ -148,7 +154,6 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
148
154
attachToElement ( container : HTMLElement ) {
149
155
// Update the theme when attaching as the terminal location could have changed
150
156
this . _updateTheme ( ) ;
151
-
152
157
if ( ! this . _container ) {
153
158
this . raw . open ( container ) ;
154
159
}
0 commit comments