Properly enable serial logging on startup if configured
(cherry picked from commit 2261ddf)
Only match "rs"/"resend" on the start of a line, otherwise the wrong lines might be interpreted as resend requests
(cherry picked from commit ae09a50)
Check if self._comm is None before trying to select a file...
(cherry picked from commit 5631a45)