diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2024-02-12 06:26:25 -0600 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-02-12 13:49:01 +0100 |
commit | 2236e8bbeb262e22bb9262390b803108122a7a94 (patch) | |
tree | e2b262aaf934436e55880fd683371aba70090847 /main.go | |
parent | 99aa51b7348b178984264ed8c940b983c1205cdd (diff) | |
download | aerc-2236e8bbeb262e22bb9262390b803108122a7a94.tar.gz |
aerc: set title using vaxis
Set the window title using Vaxis at UI initialization.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -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}) |