Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 6dbcbe8

Browse files
committed
fix(plugins/plugin-kubectl): kubectl Logs/Events/Terminal tabs do not reflow on sidecar maximize
Fixes #5417
1 parent 9e7f858 commit 6dbcbe8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

plugins/plugin-kubectl/src/lib/view/modes/ExecIntoPod.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
ToolbarText,
2626
i18n,
2727
getPrimaryTabId,
28+
eventBus,
2829
eventChannelUnsafe
2930
} from '@kui-shell/core'
3031

@@ -124,22 +125,28 @@ export class Terminal<S extends TerminalState = TerminalState> extends Container
124125

125126
this.updateToolbar(this.state.isLive)
126127

128+
// tab uuid
129+
const uuid = getPrimaryTabId(this.props.tab)
130+
127131
const focus = () => {
128132
this.doFocus()
129133
this.doXon()
130134
}
131-
const focusOnEvent = `/mode/focus/on/tab/${getPrimaryTabId(this.props.tab)}/mode/terminal`
135+
const focusOnEvent = `/mode/focus/on/tab/${uuid}/mode/terminal`
132136
eventChannelUnsafe.on(focusOnEvent, focus)
133137
this.cleaners.push(() => eventChannelUnsafe.off(focusOnEvent, focus))
134138

135139
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`
137141
eventChannelUnsafe.on(focusOffEvent, xoff)
138142
this.cleaners.push(() => eventChannelUnsafe.off(focusOffEvent, xoff))
139143

140144
const resizeListener = this.onResize.bind(this)
141145
window.addEventListener('resize', resizeListener)
142146
this.cleaners.push(() => window.removeEventListener('resize', resizeListener))
147+
148+
eventBus.onTabLayoutChange(uuid, resizeListener)
149+
this.cleaners.push(() => eventBus.offTabLayoutChange(uuid, resizeListener))
143150
}
144151

145152
/** Which container should we focus on by default? */

0 commit comments

Comments
 (0)