Instead of sending every line directly to shlex it using a list as a buffer for lines ending with a backslash and join them together as one command before coninue processing.
That fixes the issue that the program dies with an exception when a line ends with a backslash (and the quotes are note closed) but it also leads to the behaviour that such broken lines are handle as a single line on replay and on recording.
Fix for:
Instead of sending every line directly to shlex it using a list as a buffer for lines ending with a backslash and join them together as one command before coninue processing.
That fixes the issue that the program dies with an exception when a line ends with a backslash (and the quotes are note closed) but it also leads to the behaviour that such broken lines are handle as a single line on replay and on recording.