Skip to content

Commit eaa7b8d

Browse files
committed
Add DEBUG notes for terminal event reactor
1 parent 87870b6 commit eaa7b8d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Terminal/Widgets/Terminal.rakumod

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ class Terminal::Widgets::Terminal
5757
#| Enter raw input mode, enable mouse events, and start per-terminal
5858
#| event reactor ready to pass events to toplevels
5959
method start {
60+
my $debug = +($*DEBUG // 0);
61+
62+
note "Terminal entering raw mode" if $debug;
6063
self.enter-raw-mode;
6164
self.set-mouse-event-mode(MouseNormalEvents);
6265

66+
note "Terminal reactor starting up" if $debug;
6367
react {
6468
# Handle events from the control channel
6569
whenever $.control {
@@ -95,16 +99,18 @@ class Terminal::Widgets::Terminal
9599
my $event = $_ ~~ MouseTrackingEvent
96100
?? Terminal::Widgets::Events::MouseEvent.new(mouse => $_)
97101
!! Terminal::Widgets::Events::KeyboardEvent.new(key => $_);
98-
# note $event;
102+
note $event if $debug;
99103

100104
# Send the high-level event to the current toplevel for processing
101105
.process-event($event) with $.current-toplevel;
102106
}
103107

104108
# Let watchers know the terminal reactor has started
109+
note "Terminal reactor started" if $debug;
105110
$!started-vow.keep(True);
106111
}
107112

113+
note "Terminal reactor shutting down" if $debug;
108114
self!shutdown;
109115
}
110116

0 commit comments

Comments
 (0)