You are correct that Ctrl-D would only quite an active command line process. Ctrl-C will kill the notebook server, and then Ctrl-D kills Sage (if, for instance, you did some command line stuff before you did the notebook with the command notebook()).