File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,16 @@ namespace casioemu {
9
9
namespace logger {
10
10
void Info (const char *format, ...) {
11
11
// * TODO may introduce race condition
12
- // if (RL_ISSTATE(RL_STATE_TERMPREPPED ))
12
+ if (RL_ISSTATE (RL_STATE_READCMD ))
13
13
rl_clear_visible_line ();
14
14
va_list args;
15
15
va_start (args, format);
16
16
vprintf (format, args);
17
17
va_end (args);
18
- // if (RL_ISSTATE(RL_STATE_TERMPREPPED )) {
18
+ if (RL_ISSTATE (RL_STATE_READCMD )) {
19
19
rl_on_new_line ();
20
20
rl_redisplay ();
21
- // }
21
+ }
22
22
}
23
23
}
24
24
} // namespace casioemu
Original file line number Diff line number Diff line change @@ -89,6 +89,15 @@ int main(int argc, char *argv[]) {
89
89
test_gui ();
90
90
std::thread console_input_thread ([&] {
91
91
struct terminate_thread {};
92
+ rl_event_hook = []() {
93
+ throw terminate_thread{};
94
+ return 0 ;
95
+ };
96
+ try {
97
+ (void )readline (" " );
98
+ } catch (terminate_thread) {
99
+ rl_cleanup_after_signal ();
100
+ } // an ugly hack to make readline not print a extranous line when calling rl_clear_visible_line
92
101
rl_event_hook = []() {
93
102
if (!running)
94
103
throw terminate_thread{};
You can’t perform that action at this time.
0 commit comments