Table of Contents

Event SessionBegun

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

Raised by Begin(IRunnable) after the new SessionToken has been pushed onto SessionStack and TopRunnable has been set, but before IsRunningChanged and IsModalChanged fire. This event reports a token-lifecycle moment, not a state transition on the IRunnable.

event EventHandler<SessionTokenEventArgs>? SessionBegun

Returns

EventHandler<SessionTokenEventArgs>
Raised by after the new has been pushed onto and has been set, but before and fire. This event reports a token-lifecycle moment, not a state transition on the .

Remarks

To observe the runnable transitioning to the running state, subscribe to IsRunningChanged. SessionBegun is not a substitute: at the moment it fires, the cached IsRunning value is still false because SetIsRunning(bool) has not yet been called. Subscribers that need post-state-change semantics must use IsRunningChanged.

SessionBegun and SessionEnded are intentionally NOT a symmetric before/after pair. SessionBegun fires early — after the token has been pushed onto SessionStack but before the runnable's running/modal state has been published. SessionEnded fires late — after all state has unwound. This asymmetry is deliberate: the events mark token-lifecycle boundaries, not runnable-state transitions.

If StopAfterFirstIteration is true, callers to Begin(IRunnable) must also subscribe to SessionEnded and call End(SessionToken) themselves to complete the session.