c++command-line-tool

How exit replxx using SigInt from another thread


I use replxx as modern command-line tool. I found example but in this example there is only one thread. I make separated thread for replxx, from main thread I want ask replxx to exit... How do it?

I already have founded similar topic, this is also about multithreading but about another feature, I want to exit..


Solution

  • 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.