mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
tui: improve prompt layout and keyboard shortcuts
This commit is contained in:
parent
f6eba54636
commit
9d54cdac08
2 changed files with 19 additions and 15 deletions
|
|
@ -200,21 +200,26 @@ export function Prompt(props: PromptProps) {
|
|||
</box>
|
||||
<box backgroundColor={Theme.backgroundElement} width={1} justifyContent="center" alignItems="center"></box>
|
||||
</box>
|
||||
<box paddingLeft={2} paddingRight={1} flexDirection="row" justifyContent="space-between">
|
||||
<Switch>
|
||||
<Match when={working()}>
|
||||
<text>working...</text>
|
||||
</Match>
|
||||
<Match when={true}>
|
||||
<text>
|
||||
enter <span style={{ fg: Theme.textMuted }}>send</span>
|
||||
</text>
|
||||
</Match>
|
||||
</Switch>
|
||||
<box flexDirection="row" justifyContent="space-between">
|
||||
<text flexShrink={0} wrap={false}>
|
||||
<span style={{ fg: Theme.textMuted }}>{local.model.parsed().provider}</span>{" "}
|
||||
<span style={{ bold: true }}>{local.model.parsed().model}</span>
|
||||
</text>
|
||||
<Switch>
|
||||
<Match when={working()}>
|
||||
<box flexDirection="row" gap={1}>
|
||||
<text>
|
||||
esc <span style={{ fg: Theme.textMuted }}>interrupt</span>
|
||||
</text>
|
||||
<text fg={Theme.textMuted}>working...</text>
|
||||
</box>
|
||||
</Match>
|
||||
<Match when={true}>
|
||||
<text>
|
||||
ctrl+k <span style={{ fg: Theme.textMuted }}>commands</span>
|
||||
</text>
|
||||
</Match>
|
||||
</Switch>
|
||||
</box>
|
||||
</box>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ export const TuiCommand = cmd({
|
|||
await Instance.disposeAll()
|
||||
renderer.destroy()
|
||||
await EventLoop.wait()
|
||||
process.exit(0)
|
||||
}
|
||||
})
|
||||
return (
|
||||
|
|
@ -111,7 +110,7 @@ function App() {
|
|||
return
|
||||
}
|
||||
|
||||
if (evt.ctrl && evt.name === "p") {
|
||||
if (evt.ctrl && evt.name === "k") {
|
||||
dialog.replace(() => <DialogCommand />)
|
||||
return
|
||||
}
|
||||
|
|
@ -164,8 +163,8 @@ function App() {
|
|||
<text fg={Theme.textMuted}>{process.cwd().replace(Global.Path.home, "~")}</text>
|
||||
</box>
|
||||
</box>
|
||||
<box flexDirection="row">
|
||||
<text paddingRight={1} fg={Theme.textMuted}>
|
||||
<box flexDirection="row" flexShrink={0}>
|
||||
<text fg={Theme.textMuted} paddingRight={1}>
|
||||
tab
|
||||
</text>
|
||||
<text fg={local.agent.color(local.agent.current().name)}>┃</text>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue