From 2236e8bbeb262e22bb9262390b803108122a7a94 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Mon, 12 Feb 2024 06:26:25 -0600 Subject: aerc: set title using vaxis Set the window title using Vaxis at UI initialization. Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- main.go | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index fe8a8333..a9a433f1 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ package main import ( - "bytes" "context" "errors" "fmt" @@ -14,8 +13,6 @@ import ( "time" "git.sr.ht/~rjarry/go-opt" - "github.com/mattn/go-isatty" - "github.com/xo/terminfo" "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" @@ -98,27 +95,6 @@ func buildInfo() string { return info } -func setWindowTitle() { - log.Tracef("Parsing terminfo") - ti, err := terminfo.LoadFromEnv() - if err != nil { - log.Warnf("Cannot get terminfo: %v", err) - return - } - - if !ti.Has(terminfo.HasStatusLine) { - log.Infof("Terminal does not have status line support") - return - } - - log.Debugf("Setting terminal title") - buf := new(bytes.Buffer) - ti.Fprintf(buf, terminfo.ToStatusLine) - fmt.Fprint(buf, "aerc") - ti.Fprintf(buf, terminfo.FromStatusLine) - os.Stderr.Write(buf.Bytes()) -} - type Opts struct { Help bool `opt:"-h" action:"ShowHelp"` Version bool `opt:"-v" action:"ShowVersion"` @@ -248,10 +224,6 @@ func main() { } } - if isatty.IsTerminal(os.Stderr.Fd()) { - setWindowTitle() - } - go func() { defer log.PanicHandler() err := hooks.RunHook(&hooks.AercStartup{Version: Version}) -- cgit