Skip to content

Commit bb17d14

Browse files
committed
feat(tui): theme override with OPENCODE_THEME
1 parent cd0b2ae commit bb17d14

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/tui/cmd/opencode/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ func main() {
7070
}()
7171

7272
// Create main context for the application
73-
7473
app_, err := app.New(ctx, version, appInfo, modes, httpClient, model, prompt, mode)
7574
if err != nil {
7675
panic(err)
@@ -79,7 +78,6 @@ func main() {
7978
program := tea.NewProgram(
8079
tui.NewModel(app_),
8180
tea.WithAltScreen(),
82-
// tea.WithKeyboardEnhancements(),
8381
tea.WithMouseCellMotion(),
8482
)
8583

packages/tui/internal/app/app.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package app
33
import (
44
"context"
55
"fmt"
6+
"os"
67
"path/filepath"
78
"sort"
89
"strings"
@@ -103,6 +104,10 @@ func New(
103104
if configInfo.Theme != "" {
104105
appState.Theme = configInfo.Theme
105106
}
107+
themeEnv := os.Getenv("OPENCODE_THEME")
108+
if themeEnv != "" {
109+
appState.Theme = themeEnv
110+
}
106111

107112
var modeIndex int
108113
var mode *opencode.Mode

0 commit comments

Comments
 (0)