This repository was archived by the owner on Jul 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
plugins/plugin-kubectl/src/lib/view/modes Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
25
25
ToolbarText ,
26
26
i18n ,
27
27
getPrimaryTabId ,
28
+ eventBus ,
28
29
eventChannelUnsafe
29
30
} from '@kui-shell/core'
30
31
@@ -124,22 +125,28 @@ export class Terminal<S extends TerminalState = TerminalState> extends Container
124
125
125
126
this . updateToolbar ( this . state . isLive )
126
127
128
+ // tab uuid
129
+ const uuid = getPrimaryTabId ( this . props . tab )
130
+
127
131
const focus = ( ) => {
128
132
this . doFocus ( )
129
133
this . doXon ( )
130
134
}
131
- const focusOnEvent = `/mode/focus/on/tab/${ getPrimaryTabId ( this . props . tab ) } /mode/terminal`
135
+ const focusOnEvent = `/mode/focus/on/tab/${ uuid } /mode/terminal`
132
136
eventChannelUnsafe . on ( focusOnEvent , focus )
133
137
this . cleaners . push ( ( ) => eventChannelUnsafe . off ( focusOnEvent , focus ) )
134
138
135
139
const xoff = this . doXoff . bind ( this )
136
- const focusOffEvent = `/mode/focus/off/tab/${ getPrimaryTabId ( this . props . tab ) } /mode/terminal`
140
+ const focusOffEvent = `/mode/focus/off/tab/${ uuid } /mode/terminal`
137
141
eventChannelUnsafe . on ( focusOffEvent , xoff )
138
142
this . cleaners . push ( ( ) => eventChannelUnsafe . off ( focusOffEvent , xoff ) )
139
143
140
144
const resizeListener = this . onResize . bind ( this )
141
145
window . addEventListener ( 'resize' , resizeListener )
142
146
this . cleaners . push ( ( ) => window . removeEventListener ( 'resize' , resizeListener ) )
147
+
148
+ eventBus . onTabLayoutChange ( uuid , resizeListener )
149
+ this . cleaners . push ( ( ) => eventBus . offTabLayoutChange ( uuid , resizeListener ) )
143
150
}
144
151
145
152
/** Which container should we focus on by default? */
You can’t perform that action at this time.
0 commit comments