Executing a command with a trailing new line (\n) using cmd_exec kills Linux ssh sessions.
The following will kill a SSH session (Reason: Died):
The same is not true for shell and Meterpreter sessions. The command is executed and the session survives.