Solution here. From main thread ask replxx's thread to exit using
consoleWorker->rx.emulate_key_press(Replxx::KEY::control( 'C' ));
Where consoleWorker is object from replxx's thread and rx is Replxx object themself. There is full-code replxx multithreading example.