A key's answer waits for the next frame, so the default 60 fps put a 16 ms floor under key-to-screen latency. The renderer writes only when the view changed, so an idle screen costs no more.
- commit
- cedd61e40a14226726a7ae431746bb6e427af0c6
- parent
- 09e6bb69bb3ab47bfea0474dad0721b4ec19d90b
- author
- Dami <dami.etoile@gmail.com>
| M | cmd/ | 2 | +- |
| M | internal/ | 2 | +- |
@@ -45,7 +45,7 @@ func system() env {
4545 getenv: os.Getenv, keys: keyring.System(),4646 stdin: os.Stdin, stdout: os.Stdout, stderr: os.Stderr,4747 readKey: readPassword, isTTY: isTerminal(os.Stdin), editorIO: true,48- runTUI: func(m tea.Model) error { _, err := tea.NewProgram(m).Run(); return err },48+ runTUI: func(m tea.Model) error { _, err := tea.NewProgram(m, tea.WithFPS(ui.FrameRate)).Run(); return err },4949 }5050 }5151 @@ -214,7 +214,7 @@ func (s *Server) run(sess ssh.Session, pty ssh.Pty, winch <-chan ssh.Window) (id
214214 m.EnableJEV(s.jev, jev.NewCache())215215 }216216 in := newActivity(sess)217- p := tea.NewProgram(m, append(bm.MakeOptions(sess), tea.WithInput(in))...)217+ p := tea.NewProgram(m, append(bm.MakeOptions(sess), tea.WithInput(in), tea.WithFPS(ui.FrameRate))...)218218 219219 // The connection's context ends when the client goes away; cancel220220 // stops the goroutines below when the program quits first.