mirror of
https://github.com/db9979/sshtermy.git
synced 2026-12-06 20:54:09 +01:00
* Leistungsanzeige verständlicher, Zeichnen etwa doppelt so schnell - Anzeige bewertet die Zeichenzeit in Worten (flüssig/gut/etwas träge/ruckelt), zwei Zeilen Balken je Bild statt Braille-Punkte, "möglich"-Bildrate, 1 Bild/s im Leerlauf wird erklärt; im Terminal links neben der F6-Leiste, Toasts weichen darunter aus - Overlays (Toasts, Tooltip, Ausblenden, Leistungsanzeige) ohne Compositor: stamp() fasst nur die überdeckten Zeilen an - Terminalbild wird gemerkt, solange keine neue Ausgabe kam (Term.Gen) - Seitenleiste ohne lipgloss-Umbruch anfügen (beside), Verläufe in einem Render - ViewHL misst bereits aufgefüllte Zeilen nicht noch einmal - Benchmarks: Terminal 2,9 → 0,9 ms, mit F6 + Anzeige 6,5 → 2,3 ms, mit laufender Ausgabe 6,9 → 3,5 ms je Bild Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUk5KxaHH89KrFPon9n * Zeichnen noch einmal fast doppelt so schnell - x/ansi als Fork (third_party/ansi): ASCII-Schnellweg in FirstGraphemeCluster, lipgloss misst jede Zeile jedes Bildes - Terminal-Zeilen unter einer Sperre holen (vt LineCopy), Farbregeln aus denselben Zellen statt jede Zelle zweimal einzeln - Seitenleiste (F6, Ziel, …) gemerkt, solange ihr Inhalt gleich bleibt - Balken der Leistungsanzeige je Farbe in einem Render - Benchmark mit F6, Anzeige und laufender Ausgabe: 3,5 → 1,8 ms je Bild Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUk5KxaHH89KrFPon9n --------- Co-authored-by: Claude <noreply@anthropic.com>
50 lines
1.6 KiB
Go
50 lines
1.6 KiB
Go
package ansi
|
|
|
|
import "strconv"
|
|
|
|
// ResetProgressBar is a sequence that resets the progress bar to its default
|
|
// state (hidden).
|
|
//
|
|
// OSC 9 ; 4 ; 0 BEL
|
|
//
|
|
// See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences
|
|
const ResetProgressBar = "\x1b]9;4;0\x07"
|
|
|
|
// SetProgressBar returns a sequence for setting the progress bar to a specific
|
|
// percentage (0-100) in the "default" state.
|
|
//
|
|
// OSC 9 ; 4 ; 1 Percentage BEL
|
|
//
|
|
// See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences
|
|
func SetProgressBar(percentage int) string {
|
|
return "\x1b]9;4;1;" + strconv.Itoa(min(max(0, percentage), 100)) + "\x07"
|
|
}
|
|
|
|
// SetErrorProgressBar returns a sequence for setting the progress bar to a
|
|
// specific percentage (0-100) in the "Error" state..
|
|
//
|
|
// OSC 9 ; 4 ; 2 Percentage BEL
|
|
//
|
|
// See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences
|
|
func SetErrorProgressBar(percentage int) string {
|
|
return "\x1b]9;4;2;" + strconv.Itoa(min(max(0, percentage), 100)) + "\x07"
|
|
}
|
|
|
|
// SetIndeterminateProgressBar is a sequence that sets the progress bar to the
|
|
// indeterminate state.
|
|
//
|
|
// OSC 9 ; 4 ; 3 BEL
|
|
//
|
|
// See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences
|
|
const SetIndeterminateProgressBar = "\x1b]9;4;3\x07"
|
|
|
|
// SetWarningProgressBar is a sequence that sets the progress bar to the
|
|
// "Warning" state.
|
|
//
|
|
// OSC 9 ; 4 ; 4 Percentage BEL
|
|
//
|
|
// See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences
|
|
func SetWarningProgressBar(percentage int) string {
|
|
return "\x1b]9;4;4;" + strconv.Itoa(min(max(0, percentage), 100)) + "\x07"
|
|
}
|