daniele77 / cli

A library for interactive command line interfaces in modern C++
Boost Software License 1.0
1.23k stars 140 forks source link

How to add internal command used to enter system shell #212

Closed marklion closed 1 year ago

marklion commented 1 year ago

I am trying to add an internal command like 'bash', which should be used to open an system shell like '/bin/bash' from current terminal. But it seems not working as my expect when I write this kind of code below.

root_menu->Insert(
        "bash", [](std::ostream &out)
        { system("/bin/bash"); });

The process exit after I issued 'bash' command.

Thanks for your kindly help.