Skip to content

Commit 020d4a2

Browse files
committed
chore: minor code cleanup in AskingTerminal
1 parent 89735ff commit 020d4a2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

plugins/plugin-madwizard/components/src/AskingTerminal.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,29 +220,29 @@ export default class AskingTerminal extends React.PureComponent<Props, State> {
220220
}
221221
}
222222

223-
private readonly initialContent = new Chalk({ level: 2 }).dim.italic("Logs will appear here")
223+
/** Placeholder content for terminal */
224+
private readonly initialTerminalContent = new Chalk({ level: 2 }).dim.italic("Logs will appear here")
225+
226+
/** React `key` prop for terminal */
227+
private get terminalKey() {
228+
return (
229+
this.state.myInitCount + "_" + this.props.initCount + "_" + this.props.cmdline + "-" + this.props.selectedProfile
230+
)
231+
}
224232

225233
private terminal() {
226234
return (
227235
<SelectedProfileTerminal
228236
searchable={false}
229-
initialContent={this.initialContent}
237+
env={this.props.env}
238+
key={this.terminalKey}
239+
initialContent={this.initialTerminalContent}
230240
fontSizeAdjust={1 /* relative to 14px */}
231-
key={
232-
this.state.myInitCount +
233-
"_" +
234-
this.props.initCount +
235-
"_" +
236-
this.props.cmdline +
237-
"-" +
238-
this.props.selectedProfile
239-
}
240241
cmdline={this.props.cmdline + this.extraCommandLine}
241-
env={this.props.env}
242242
selectedProfile={this.props.selectedProfile}
243-
intercept={this._onTerminalLine}
244243
onInit={this._onTerminalInit}
245244
onExit={this._onTerminalExit}
245+
intercept={this._onTerminalLine /* intercept terminal output lines */}
246246
restartOnExit={false /* don't auto-restart on exit */}
247247
{...this.props.terminalProps}
248248
/>

0 commit comments

Comments
 (0)