refactor: set terminal title when InitEvent arrives

This commit is contained in:
ayn2op 2026-03-03 22:55:46 -05:00
parent 7f82d3103d
commit aa6845949f
2 changed files with 2 additions and 4 deletions

View file

@ -6,7 +6,6 @@ import (
"log/slog"
"github.com/ayn2op/discordo/internal/config"
"github.com/ayn2op/discordo/internal/consts"
"github.com/ayn2op/discordo/internal/logger"
"github.com/ayn2op/discordo/internal/ui/root"
"github.com/ayn2op/tview"
@ -60,8 +59,6 @@ func Run() error {
if cfg.Mouse {
screen.EnableMouse()
}
screen.SetTitle(consts.Name)
screen.EnablePaste()
screen.EnableFocus()

View file

@ -6,6 +6,7 @@ import (
"github.com/ayn2op/discordo/internal/clipboard"
"github.com/ayn2op/discordo/internal/config"
"github.com/ayn2op/discordo/internal/consts"
"github.com/ayn2op/discordo/internal/keyring"
"github.com/ayn2op/discordo/internal/ui/chat"
"github.com/ayn2op/discordo/internal/ui/login"
@ -93,7 +94,7 @@ func (v *View) HandleEvent(event tcell.Event) tview.Command {
return tview.QuitCommand{}
}
}
return tview.SetFocusCommand{Target: v.inner}
return tview.BatchCommand{tview.SetTitleCommand(consts.Name), tview.SetFocusCommand{Target: v.inner}}
case *tview.KeyEvent:
switch {