Add function to copy last executed command.