fix: disable init() function in github/charmbracelet/bubbletea dependency (#15817)

- Fixes an issue where an init function
causes writes to the terminal when using `agent-exec` which results in raw
ansi characters being printed to the web terminal.
- Was also causing significant latency in launching a web terminal
This commit is contained in:
Jon Ayers
2024-12-16 20:58:36 +02:00
committed by GitHub
parent 202f7f70f0
commit 05914cb929
4 changed files with 17 additions and 4 deletions
+5
View File
@@ -5,6 +5,8 @@ import (
"os"
_ "time/tzdata"
tea "github.com/charmbracelet/bubbletea"
"github.com/coder/coder/v2/agent/agentexec"
"github.com/coder/coder/v2/cli"
)
@@ -15,6 +17,9 @@ func main() {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
// This preserves backwards compatibility with an init function that is causing grief for
// web terminals using agent-exec + screen. See https://github.com/coder/coder/pull/15817
tea.InitTerminal()
var rootCmd cli.RootCmd
rootCmd.RunWithSubcommands(rootCmd.AGPL())
}