[Lldb-commits] [PATCH] D79654: [lldb/Driver] Support terminal resizing

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 11 04:15:29 PDT 2020


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Yes, resizing the window (or doing any other nontrivial task) from within a signal handler is a bad idea. Making a note of the signal and then bailing out is the right approach. Though, to be fully strictly correct, the variable ought to be a `volatile std::sig_atomic_t` instead of a plain bool. This still won't make the whole thing async-signal-safe (I haven't inspected the whole SIGWINCH call stack, but I am sure there are still some unsafe operations there), but it's a step towards that.

If we wanted to avoid delaying the change to the next keystroke, we could reuse the same mechanism that ^C/SIGINT uses (`m_input_connection.InterruptRead()`). That would probably require introduction of a new `EditorStatus` enum, and a careful modification to the code handling the input interruption. I don't expect that to be _too_ hard, but I also don't think that's required for this change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79654/new/

https://reviews.llvm.org/D79654





More information about the lldb-commits mailing list