mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-16 21:15:57 +03:00
fix(tui): display slash command aliases (#48544)
This commit is contained in:
@@ -821,7 +821,7 @@ function App(props: { pair?: DialogPairCredentials }) {
|
||||
title: "Switch model",
|
||||
suggested: true,
|
||||
category: "Agent",
|
||||
slash: { name: "models", aliases: ["mo"] },
|
||||
slash: { name: "models" },
|
||||
run: () => {
|
||||
dialog.replace(() => <DialogModel />)
|
||||
},
|
||||
@@ -902,7 +902,7 @@ function App(props: { pair?: DialogPairCredentials }) {
|
||||
title: "Switch model variant",
|
||||
category: "Agent",
|
||||
palette: local.model.variant.list().length === 0 ? undefined : (true as const),
|
||||
slash: { name: "variants" },
|
||||
slash: { name: "variants", aliases: ["thinking"] },
|
||||
run: () => {
|
||||
if (local.model.variant.list().length === 0) {
|
||||
return toast.show({
|
||||
|
||||
@@ -503,12 +503,11 @@ export function Autocomplete(props: {
|
||||
const results: AutocompleteOption[] = keymapCommands().flatMap((command) => {
|
||||
const slash = command.slash
|
||||
if (!slash) return []
|
||||
return {
|
||||
display: `/${slash.name}`,
|
||||
return [slash.name, ...(slash.aliases ?? [])].map((name) => ({
|
||||
display: `/${name}`,
|
||||
description: command.description ?? command.title,
|
||||
aliases: slash.aliases?.map((alias) => `/${alias}`),
|
||||
onSelect: slash.arguments ? () => insertSlash(slash.name) : command.run,
|
||||
}
|
||||
onSelect: slash.arguments ? () => insertSlash(name) : command.run,
|
||||
}))
|
||||
})
|
||||
const commandNames = new Set<string>()
|
||||
|
||||
|
||||
@@ -619,7 +619,7 @@ export function Prompt(props: PromptProps) {
|
||||
desc: "Manage workspaces",
|
||||
name: "session.move",
|
||||
category: "Session",
|
||||
slash: { name: "worktrees", aliases: ["move", "mov"] },
|
||||
slash: { name: "worktrees" },
|
||||
run: () => {
|
||||
move.open()
|
||||
},
|
||||
|
||||
@@ -946,10 +946,6 @@ export function Session(props: {
|
||||
id: "session.toggle.thinking",
|
||||
group: "Session",
|
||||
palette: undefined,
|
||||
slash: {
|
||||
name: "thinking",
|
||||
aliases: ["toggle-thinking"],
|
||||
},
|
||||
run: () => {
|
||||
void configState
|
||||
.update((draft) => {
|
||||
|
||||
Reference in New Issue
Block a user