fix(core): preserve shell list metadata

This commit is contained in:
rekram1-node
2026-08-23 18:02:38 +00:00
committed by Hona
parent 51528c33e9
commit 9018aa700a
3 changed files with 7 additions and 7 deletions
@@ -3,7 +3,7 @@ import { onCleanup } from "solid-js"
export type ShellOption = {
path: string
name: string
compatible: boolean
acceptable: boolean
}
export type ShellSelectOption = {
@@ -27,7 +27,7 @@ export function createShellOptions(input: { shells: ShellOption[]; current: stri
id: shell.path,
value: ambiguous ? shell.path : shell.name,
name,
terminalOnly: !shell.compatible,
terminalOnly: !shell.acceptable,
}
}),
]
@@ -7,9 +7,9 @@ describe("settings controllers", () => {
expect(
createShellOptions({
shells: [
{ path: "/bin/bash", name: "bash", compatible: true },
{ path: "/opt/bash", name: "bash", compatible: false },
{ path: "/bin/zsh", name: "zsh", compatible: true },
{ path: "/bin/bash", name: "bash", acceptable: true },
{ path: "/opt/bash", name: "bash", acceptable: false },
{ path: "/bin/zsh", name: "zsh", acceptable: true },
],
current: "fish",
}),
+2 -2
View File
@@ -25,7 +25,7 @@ const META: Record<string, { deny?: boolean; login?: boolean; ps?: boolean }> =
export type Item = {
path: string
name: string
compatible: boolean
acceptable: boolean
}
export const Options = Schema.Struct({
@@ -156,7 +156,7 @@ function info(file: string, options?: Options, bin?: string): Item {
return {
path: item,
name: executable(n, options, bin) ? n : item,
compatible: compatible(item),
acceptable: compatible(item),
}
}