mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 14:14:17 +00:00
Don't query for terminal dimensions when starting up
This commit is contained in:
parent
131685b5f2
commit
e685dea17a
1 changed files with 3 additions and 9 deletions
6
ui/ui.go
6
ui/ui.go
|
@ -15,7 +15,6 @@ import (
|
||||||
"github.com/charmbracelet/glamour"
|
"github.com/charmbracelet/glamour"
|
||||||
"github.com/muesli/reflow/indent"
|
"github.com/muesli/reflow/indent"
|
||||||
te "github.com/muesli/termenv"
|
te "github.com/muesli/termenv"
|
||||||
"golang.org/x/crypto/ssh/terminal"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -91,8 +90,6 @@ func initialize(style string) func() (boba.Model, boba.Cmd) {
|
||||||
s.Type = spinner.Dot
|
s.Type = spinner.Dot
|
||||||
s.ForegroundColor = common.SpinnerColor
|
s.ForegroundColor = common.SpinnerColor
|
||||||
|
|
||||||
w, h, err := terminal.GetSize(int(os.Stdout.Fd()))
|
|
||||||
|
|
||||||
if style == "auto" {
|
if style == "auto" {
|
||||||
dbg := te.HasDarkBackground()
|
dbg := te.HasDarkBackground()
|
||||||
if dbg == true {
|
if dbg == true {
|
||||||
|
@ -106,9 +103,6 @@ func initialize(style string) func() (boba.Model, boba.Cmd) {
|
||||||
style: style,
|
style: style,
|
||||||
spinner: s,
|
spinner: s,
|
||||||
state: stateInitCharmClient,
|
state: stateInitCharmClient,
|
||||||
err: err,
|
|
||||||
terminalWidth: w,
|
|
||||||
terminalHeight: h,
|
|
||||||
}, boba.Batch(
|
}, boba.Batch(
|
||||||
newCharmClient,
|
newCharmClient,
|
||||||
spinner.Tick(s),
|
spinner.Tick(s),
|
||||||
|
|
Loading…
Reference in a new issue