Files
cthulhu/internal/app/terminal_events.go

20 lines
788 B
Go

// Cthulhu screen reader.
// Copyright (c) 2026 Storm Dragon
// Authors: Storm Dragon, Angus Kola
// SPDX-License-Identifier: GPL-3.0-or-later
package app
import "git.stormux.org/storm/cthulhu/internal/atspi"
func should_ignore_terminal_scrollback(event atspi.Event) bool {
// VTE can remove old complete lines at the start of its accessible text
// while appending output at a different offset. These are not edits to
// the prompt. This event pattern occurs on both X11 and Wayland.
return event.Type == atspi.TextDeletedEvent &&
event.Source.Role == "terminal" && event.Detail1 == 0 &&
event.Source.TextCaretKnown && event.Source.BrailleLineStart > 0 &&
event.TextChangeEndsLine && event.TextChangeLength > 0 &&
event.TextChangeLength <= event.Source.BrailleLineStart
}