mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-24 14:43:37 -04:00
fix(core): preserve shell list metadata
This commit is contained in:
@@ -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",
|
||||
}),
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user