Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM oven/bun:1.3
WORKDIR /workspace
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"version": "2.5.9",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a",
"integrity": "sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "1.3.8",
"resolved": "ghcr.io/devcontainers/features/git@sha256:fd75977de13a9979000e0e78baf949adb0ca71d2398995fa22e0a36d7e7e7fe2",
"integrity": "sha256:fd75977de13a9979000e0e78baf949adb0ca71d2398995fa22e0a36d7e7e7fe2"
}
}
}
13 changes: 13 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "opencode-dev",
"build": { "dockerfile": "Dockerfile" },
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/git:1": {}
},
"customizations": {
"vscode": {
"extensions": ["oven.bun-vscode"]
}
}
}
9 changes: 9 additions & 0 deletions packages/tui/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ import * as TuiAudio from "./audio"
import { win32DisableProcessedInput, win32FlushInputBuffer } from "./terminal-win32"
import { destroyRenderer } from "./util/renderer"
import { cliErrorMessage, errorFormat } from "./util/error"
import { ScottyLogo } from "./component/scottyascii"

registerOpencodeSpinner()

Expand Down Expand Up @@ -674,6 +675,14 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
local.model.cycleFavorite(-1)
},
},
{
name: "scotty_dog",
title: "print ASCII art of a cute Scottish terrier",
slashName: "scotty",
run: () => {
dialog.replace(() => <ScottyLogo />)
},
},
{
name: "agent.list",
title: "Switch agent",
Expand Down
52 changes: 52 additions & 0 deletions packages/tui/src/component/scottyascii.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { TextAttributes } from "@opentui/core"
import { For } from "solid-js"
import { useTheme } from "../context/theme"
import { useDialog } from "../ui/dialog"
import { useBindings } from "../keymap"

const scotty = [
" __ __",
" / V \\",
" | o o |",
" | Δ |",
" \\ === /",
" __/| |\\__",
" / | | \\",
" | | | |",
" |____| |____|",
]

export function ScottyLogo() {
const dialog = useDialog()
const { theme } = useTheme()

useBindings(() => ({
bindings: [
{ key: "return", desc: "Close", group: "Dialog", cmd: () => dialog.clear() },
{ key: "escape", desc: "Close", group: "Dialog", cmd: () => dialog.clear() },
],
}))

return (
<box paddingLeft={2} paddingRight={2} gap={1}>
<box flexDirection="row" justifyContent="space-between">
<text attributes={TextAttributes.BOLD} fg={theme.text}>
Scotty the Scottish Terrier
</text>
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
esc/enter
</text>
</box>
<box>
<For each={scotty}>
{(line) => (
<text fg={theme.text} attributes={TextAttributes.BOLD}>
{line}
</text>
)}
</For>
</box>
<text fg={theme.textMuted}>Go Tartans!</text>
</box>
)
}
Loading
Loading