@@ -25,19 +25,20 @@ import { Emitter } from 'vs/base/common/event';
25
25
26
26
export class TerminalEditorInput extends EditorInput implements IEditorCloseHandler {
27
27
28
- protected readonly _onDidRequestAttach = this . _register ( new Emitter < ITerminalInstance > ( ) ) ;
29
- readonly onDidRequestAttach = this . _onDidRequestAttach . event ;
30
-
31
28
static readonly ID = 'workbench.editors.terminal' ;
32
29
30
+ override readonly closeHandler = this ;
31
+
33
32
private _isDetached = false ;
34
33
private _isShuttingDown = false ;
35
34
private _isReverted = false ;
36
35
private _copyLaunchConfig ?: IShellLaunchConfig ;
37
36
private _terminalEditorFocusContextKey : IContextKey < boolean > ;
38
-
39
37
private _group : IEditorGroup | undefined ;
40
38
39
+ protected readonly _onDidRequestAttach = this . _register ( new Emitter < ITerminalInstance > ( ) ) ;
40
+ readonly onDidRequestAttach = this . _onDidRequestAttach . event ;
41
+
41
42
setGroup ( group : IEditorGroup | undefined ) {
42
43
this . _group = group ;
43
44
}
@@ -64,13 +65,6 @@ export class TerminalEditorInput extends EditorInput implements IEditorCloseHand
64
65
}
65
66
this . _terminalInstance = instance ;
66
67
this . _setupInstanceListeners ( ) ;
67
-
68
- // Refresh dirty state when the confirm on kill setting is changed
69
- this . _configurationService . onDidChangeConfiguration ( e => {
70
- if ( e . affectsConfiguration ( TerminalSettingId . ConfirmOnKill ) ) {
71
- this . _onDidChangeDirty . fire ( ) ;
72
- }
73
- } ) ;
74
68
}
75
69
76
70
override copy ( ) : EditorInput {
@@ -95,7 +89,7 @@ export class TerminalEditorInput extends EditorInput implements IEditorCloseHand
95
89
return this . _isDetached ? undefined : this . _terminalInstance ;
96
90
}
97
91
98
- override isDirty ( ) : boolean {
92
+ showConfirm ( ) : boolean {
99
93
if ( this . _isReverted ) {
100
94
return false ;
101
95
}
@@ -106,12 +100,6 @@ export class TerminalEditorInput extends EditorInput implements IEditorCloseHand
106
100
return false ;
107
101
}
108
102
109
- override readonly closeHandler = this ;
110
-
111
- showConfirm ( ) : boolean {
112
- return this . isDirty ( ) ;
113
- }
114
-
115
103
async confirm ( terminals ?: ReadonlyArray < IEditorIdentifier > ) : Promise < ConfirmResult > {
116
104
const { choice } = await this . _dialogService . show (
117
105
Severity . Warning ,
@@ -154,12 +142,6 @@ export class TerminalEditorInput extends EditorInput implements IEditorCloseHand
154
142
155
143
this . _terminalEditorFocusContextKey = TerminalContextKeys . editorFocus . bindTo ( _contextKeyService ) ;
156
144
157
- // Refresh dirty state when the confirm on kill setting is changed
158
- this . _configurationService . onDidChangeConfiguration ( e => {
159
- if ( e . affectsConfiguration ( TerminalSettingId . ConfirmOnKill ) ) {
160
- this . _onDidChangeDirty . fire ( ) ;
161
- }
162
- } ) ;
163
145
if ( _terminalInstance ) {
164
146
this . _setupInstanceListeners ( ) ;
165
147
}
@@ -184,7 +166,6 @@ export class TerminalEditorInput extends EditorInput implements IEditorCloseHand
184
166
instance . onIconChanged ( ( ) => this . _onDidChangeLabel . fire ( ) ) ,
185
167
instance . onDidFocus ( ( ) => this . _terminalEditorFocusContextKey . set ( true ) ) ,
186
168
instance . onDidBlur ( ( ) => this . _terminalEditorFocusContextKey . reset ( ) ) ,
187
- instance . onDidChangeHasChildProcesses ( ( ) => this . _onDidChangeDirty . fire ( ) ) ,
188
169
instance . statusList . onDidChangePrimaryStatus ( ( ) => this . _onDidChangeLabel . fire ( ) )
189
170
] ;
190
171
0 commit comments