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

Commit 1360bed

Browse files
committed
fix(plugins/plugin-client-common): in Popup mode, use > rather than / for prompt in bottom input
Fixes #4887
1 parent 68f5841 commit 1360bed

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

plugins/plugin-client-common/src/components/Client/InputStripe.tsx

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@
1717
import * as React from 'react'
1818
import { Tab as KuiTab, eventBus } from '@kui-shell/core'
1919

20+
import KuiContext from './context'
2021
import Block from '../Views/Terminal/Block'
22+
import KuiConfiguration from './KuiConfiguration'
2123
import { InputOptions } from '../Views/Terminal/Block/Input'
2224
import BlockModel, { Active } from '../Views/Terminal/Block/BlockModel'
2325

2426
import '../../../web/css/static/InputStripe.scss'
2527

26-
type Props = InputOptions & {
27-
tab?: KuiTab
28+
type Props = Partial<KuiConfiguration> &
29+
InputOptions & {
30+
tab?: KuiTab
2831

29-
/** tab uuid; this is grafted in for you, by TabContent */
30-
uuid?: string
31-
}
32+
/** tab uuid; this is grafted in for you, by TabContent */
33+
uuid?: string
34+
}
3235

3336
interface State {
3437
idx: number
@@ -54,19 +57,21 @@ export default class InputStripe extends React.PureComponent<Props, State> {
5457

5558
public render() {
5659
return (
57-
<div className="kui--input-stripe repl">
58-
<Block
59-
idx={this.state.idx}
60-
uuid={this.props.uuid}
61-
tab={this.props.tab}
62-
model={this.state.model}
63-
noOutput
64-
noPromptContext
65-
promptPlaceholder={this.props.promptPlaceholder}
66-
>
67-
{this.props.children}
68-
</Block>
69-
</div>
60+
<KuiContext.Provider value={{ prompt: this.props.prompt || '\u276f' }}>
61+
<div className="kui--input-stripe repl">
62+
<Block
63+
idx={this.state.idx}
64+
uuid={this.props.uuid}
65+
tab={this.props.tab}
66+
model={this.state.model}
67+
noOutput
68+
noPromptContext
69+
promptPlaceholder={this.props.promptPlaceholder}
70+
>
71+
{this.props.children}
72+
</Block>
73+
</div>
74+
</KuiContext.Provider>
7075
)
7176
}
7277
}

plugins/plugin-client-common/src/components/Views/Terminal/Block/Input.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ export abstract class InputProvider<S extends State = State> extends React.PureC
125125
return (
126126
!this.props.noPromptContext && (
127127
<KuiContext.Consumer>
128-
{config => !config.noPromptContext && <span className="repl-context">{this.props.model.cwd}</span>}
128+
{config =>
129+
!config.noPromptContext && this.props.model && <span className="repl-context">{this.props.model.cwd}</span>
130+
}
129131
</KuiContext.Consumer>
130132
)
131133
)

0 commit comments

Comments
 (0)