Move prepending 'cd %r' into the ssh_channel after the command has been printed, to prevent cluttering the screen