392da53f53
Note that it still can't handle properly multi-line commands. Thanks to @jpcirrus for the bug report and the fix.