Skip to content

Commit 07f3b00

Browse files
committed
Group synthetic events at end of EventType enum
Move Invalid, Fatal, and BracketedPasteBegin/End into the same synthetic block as Resize, Start, Load, etc. The single boundary (>= Invalid) now covers every non-user event, replacing the explicit list in the keyChan activity check. BracketedPaste markers sit in the synthetic block because the paste content itself arrives as Rune events and updates lastActivity.
1 parent 463ef21 commit 07f3b00

3 files changed

Lines changed: 30 additions & 25 deletions

File tree

src/terminal.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6408,7 +6408,9 @@ func (t *Terminal) Loop() error {
64086408
select {
64096409
case event = <-t.keyChan:
64106410
needBarrier = true
6411-
t.lastActivity = time.Now()
6411+
if event.Type < tui.Invalid {
6412+
t.lastActivity = time.Now()
6413+
}
64126414
case event = <-t.timerChan:
64136415
case event = <-t.eventChan:
64146416
// Drain channel to process all queued events at once without rendering

src/tui/eventtype_string.go

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tui/tui.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@ const (
196196
CtrlAltShiftPageUp
197197
CtrlAltShiftPageDown
198198

199-
Invalid
200-
Fatal
201-
BracketedPasteBegin
202-
BracketedPasteEnd
203-
204199
Mouse
205200
DoubleClick
206201
LeftClick
@@ -214,7 +209,15 @@ const (
214209
PreviewScrollUp
215210
PreviewScrollDown
216211

217-
// Events
212+
// Synthetic / non-user events. Everything from Invalid onward is
213+
// either internally generated or a state-change notification, not
214+
// direct user input. Use `>= Invalid` to gate activity tracking.
215+
// BracketedPasteBegin/End sit here too: they enclose user input
216+
// (which arrives as Rune events) and should not appear in FZF_KEY.
217+
Invalid
218+
Fatal
219+
BracketedPasteBegin
220+
BracketedPasteEnd
218221
Resize
219222
Change
220223
BackwardEOF

0 commit comments

Comments
 (0)