diff --git a/internal/build/build.go b/internal/build/build.go index 8c3e78a7e..267315ad2 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -1,6 +1,7 @@ package build import ( + "os" "runtime/debug" ) @@ -16,4 +17,11 @@ func init() { Version = info.Main.Version } } + + // Signal the tcell library to skip its expensive `init` block. This saves 30-40ms in startup + // time for the gh process. The downside is that some Unicode glyphs from user-generated + // content might cause mis-alignment in tcell-enabled views. + // + // https://github.com/gdamore/tcell/commit/2f889d79bd61b1fd2f43372529975a65b792a7ae + _ = os.Setenv("TCELL_MINIMIZE", "1") }