InputEvent.terminal

Returns a pointer to the terminal associated with this event. (You can usually just ignore this as there's only one terminal typically.)

It may be null in the case of program-generated events;

struct InputEvent
@property
terminal
()

Meta