You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the process exits by std::terminate() after calling ScreenInteractive::Install(), the terminal is left in an untidy state. Specifically it appears to be because ScreenInteractive::Uninstall() is not run. The obvious symptom that I am facing is that when the process exits in this way, mouse events (such as moving the mouse on the terminal) cause cause a bunch of escape sequences to appear. However, there may well be other cleanup steps that cause other issues I am overlooking. My workaround at the moment is to issue reset to restore the terminal state.
I narrowed down the mouse specific issue to failure to Reset() (at least one of) DECMode::kMouseVt200, DECMode::kMouseAnyEvent, DECMode::kMouseUrxvtMode and DECMode::kMouseSgrExtMode, and was able to fix it by installing a terminate handler at the top of main() and manually issuing the missing cleanup:
FTXUI does handle SIGSTP signal to cleanup when terminating the app. This is for event outside of the app.
Here, std::terminate is called from inside the app. It is not supported.
If the process exits by
std::terminate()
after callingScreenInteractive::Install()
, the terminal is left in an untidy state. Specifically it appears to be becauseScreenInteractive::Uninstall()
is not run. The obvious symptom that I am facing is that when the process exits in this way, mouse events (such as moving the mouse on the terminal) cause cause a bunch of escape sequences to appear. However, there may well be other cleanup steps that cause other issues I am overlooking. My workaround at the moment is to issuereset
to restore the terminal state.I was able to reproduce this issue on Ubuntu 22.04 using xterm (echo $TERM -> xterm-256color) by adding a call to std::terminate() directly after a Loop is constructed, for example line 45 at https://github.com/ArthurSonzogni/FTXUI/blob/7b1f4d435bedecc49abc3f935bd97dc997a41977/examples/component/custom_loop.cpp
I narrowed down the mouse specific issue to failure to
Reset()
(at least one of)DECMode::kMouseVt200
,DECMode::kMouseAnyEvent
,DECMode::kMouseUrxvtMode
andDECMode::kMouseSgrExtMode
, and was able to fix it by installing a terminate handler at the top ofmain()
and manually issuing the missing cleanup:I hope this helps to reproduce and understand the issue, and that nicely handling
std::terminate()
is something you would be interested in addressing.The text was updated successfully, but these errors were encountered: