mirror of
https://github.com/db9979/sshtermy.git
synced 2026-12-06 20:54:09 +01:00
* MIT-Lizenz; Terminal-Verlauf kompakt, schnellerer Bildlauf, Manager mit vielen Verbindungen schneller - LICENSE (MIT), winget/Homebrew/apt-Metadaten, README, Webseite, --version - termemu: Verlauf mit 8 statt 112 Byte pro Zeichen, Ringpuffer - third_party/vt: angepasste Kopie (rotateLines, SetScrollbackHook) - Store: Connections() zwischengespeichert; Manager: buildRows ohne Teillisten, Fußzeile misst Breiten einmal - Benchmarks: make bench Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjBAAPCAZVnGzCZxdS * Testprogramm aus dem Commit entfernt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjBAAPCAZVnGzCZxdS * Testprogramm entfernt, *.test ignorieren Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjBAAPCAZVnGzCZxdS * TestSerialSession: auf stehenden Prompt warten statt auf das erste # Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjBAAPCAZVnGzCZxdS --------- Co-authored-by: Claude <noreply@anthropic.com>
30 lines
603 B
Go
30 lines
603 B
Go
package vt
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/charmbracelet/x/ansi"
|
|
)
|
|
|
|
// Focus sends the terminal a focus event if focus events mode is enabled.
|
|
// This is the opposite of [Blur].
|
|
func (e *Emulator) Focus() {
|
|
e.focus(true)
|
|
}
|
|
|
|
// Blur sends the terminal a blur event if focus events mode is enabled.
|
|
// This is the opposite of [Focus].
|
|
func (e *Emulator) Blur() {
|
|
e.focus(false)
|
|
}
|
|
|
|
func (e *Emulator) focus(focus bool) {
|
|
if mode, ok := e.modes[ansi.ModeFocusEvent]; ok && mode.IsSet() {
|
|
if focus {
|
|
_, _ = io.WriteString(e.pw, ansi.Focus)
|
|
} else {
|
|
_, _ = io.WriteString(e.pw, ansi.Blur)
|
|
}
|
|
}
|
|
}
|