Add history search with Ctrl+R
Add wait_for_process function