summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/cmd
diff options
context:
space:
mode:
authorAndrea Grandi <[email protected]>2025-07-29 18:15:04 +0200
committerGitHub <[email protected]>2025-07-29 11:15:04 -0500
commit3bd2b340c89f23b7c4ecfa368f48ffe7b3e40b22 (patch)
treef8e5d1d713ecc2589e17a8d1f2fd15d203d008f6 /packages/tui/cmd
parentdf03e182d211c0449a8aff08cd5e767f4c316aaf (diff)
downloadopencode-3bd2b340c89f23b7c4ecfa368f48ffe7b3e40b22.tar.gz
opencode-3bd2b340c89f23b7c4ecfa368f48ffe7b3e40b22.zip
feat: show current git branch in status bar, and make it responsive (#1339)
Co-authored-by: adamdotdevin <[email protected]>
Diffstat (limited to 'packages/tui/cmd')
-rw-r--r--packages/tui/cmd/opencode/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/tui/cmd/opencode/main.go b/packages/tui/cmd/opencode/main.go
index 54dbd15a5..66888fe40 100644
--- a/packages/tui/cmd/opencode/main.go
+++ b/packages/tui/cmd/opencode/main.go
@@ -101,8 +101,9 @@ func main() {
panic(err)
}
+ tuiModel := tui.NewModel(app_).(*tui.Model)
program := tea.NewProgram(
- tui.NewModel(app_),
+ tuiModel,
tea.WithAltScreen(),
tea.WithMouseCellMotion(),
)
@@ -132,6 +133,7 @@ func main() {
go func() {
sig := <-sigChan
slog.Info("Received signal, shutting down gracefully", "signal", sig)
+ tuiModel.Cleanup()
program.Quit()
}()
@@ -141,5 +143,6 @@ func main() {
slog.Error("TUI error", "error", err)
}
+ tuiModel.Cleanup()
slog.Info("TUI exited", "result", result)
}