mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user