I wanted to reach out to you rather than have a discussion within a bug where its not really right to do so.
I managed to get the call to work using:
$result = Shell::command(
' -l ' . $lexer .
' -f ' . 'html' .
' -O ' . implode( ',', $optionPairs )
Note that I had to add spaces before and after each - (dash)
But I then have the problem you described However, this isn't a complete solution, as another problem pops out: the process starts running, but never stops.
I wondered if you had any further suggestions on how to complete this solution?