feat(tui): theme override with OPENCODE_THEME
This commit is contained in:
parent
cd0b2ae032
commit
bb17d14665
2 changed files with 5 additions and 2 deletions
|
|
@ -70,7 +70,6 @@ func main() {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Create main context for the application
|
// Create main context for the application
|
||||||
|
|
||||||
app_, err := app.New(ctx, version, appInfo, modes, httpClient, model, prompt, mode)
|
app_, err := app.New(ctx, version, appInfo, modes, httpClient, model, prompt, mode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
@ -79,7 +78,6 @@ func main() {
|
||||||
program := tea.NewProgram(
|
program := tea.NewProgram(
|
||||||
tui.NewModel(app_),
|
tui.NewModel(app_),
|
||||||
tea.WithAltScreen(),
|
tea.WithAltScreen(),
|
||||||
// tea.WithKeyboardEnhancements(),
|
|
||||||
tea.WithMouseCellMotion(),
|
tea.WithMouseCellMotion(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package app
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -103,6 +104,10 @@ func New(
|
||||||
if configInfo.Theme != "" {
|
if configInfo.Theme != "" {
|
||||||
appState.Theme = configInfo.Theme
|
appState.Theme = configInfo.Theme
|
||||||
}
|
}
|
||||||
|
themeEnv := os.Getenv("OPENCODE_THEME")
|
||||||
|
if themeEnv != "" {
|
||||||
|
appState.Theme = themeEnv
|
||||||
|
}
|
||||||
|
|
||||||
var modeIndex int
|
var modeIndex int
|
||||||
var mode *opencode.Mode
|
var mode *opencode.Mode
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue