fix(tui): display slash command aliases (#48544)

This commit is contained in:
Dax
2026-09-11 15:34:33 -04:00
committed by GitHub
Unverified
parent bb564f96a3
commit 8f2b13e864
4 changed files with 7 additions and 12 deletions
+2 -2
View File
@@ -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>()
+1 -1
View File
@@ -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) => {