ply-terminal: Log when terminal input gets enabled/disabled

We're currently seeing a bug where it seems like the terminal might
be getting intermittently disabled.

This commit adds some logging to confirm or rule out that possibility.
This commit is contained in:
Ray Strode 2023-12-30 08:53:03 -05:00 committed by Ray Strode
parent 35c86e41bb
commit fa38ccda61

View file

@ -241,6 +241,9 @@ ply_terminal_set_unbuffered_input (ply_terminal_t *terminal)
ply_terminal_unlock (terminal);
if (terminal->is_disabled)
ply_trace ("terminal input is getting enabled in unbuffered mode");
terminal->is_disabled = false;
if (ply_terminal_is_vt (terminal))
@ -276,6 +279,9 @@ ply_terminal_set_buffered_input (ply_terminal_t *terminal)
{
struct termios term_attributes;
if (terminal->is_disabled)
ply_trace ("terminal input is getting enabled in buffered mode");
terminal->is_disabled = false;
if (ply_terminal_is_vt (terminal))
@ -324,6 +330,10 @@ ply_terminal_set_buffered_input (ply_terminal_t *terminal)
bool
ply_terminal_set_disabled_input (ply_terminal_t *terminal)
{
if (!terminal->is_disabled)
ply_trace ("terminal input is getting disabled from %s mode",
terminal->is_unbuffered? "unbuffered" : "buffered");
terminal->is_disabled = true;
if (ply_terminal_is_vt (terminal))