On Mar 6, 2009, at 9:44 AM, Mark Volkmann wrote:

ctrl-c is the right way to exit under Windows.
Under UNIX, Linux and Mac OS X, I think ctrl-d is preferred.


I agree.

Here's some more info:

On the Unixes, ctl-d represents "end-of-file" (end of input stream). Usually terminals and terminal-like interfaces will send ctl-d immediately to the process waiting for input even in cases where input would normally be line-buffered before being sent. ctl-d works to quit the repl immediately on Linux and Mac OS X.

On Windows the corresponding end-of-file marker is ctl-z. However in a default "cmd" window ctl-z doesn't act immediately. Instead, it's interpreted after pressing return. Both "ctl-z return" and "ctl-c" work to quit the clojure Repl on Windows. As the latter is more succinct, I think it's reasonable for it to be preferred.

(System/exit 0) also works on all platforms.

Having something like:

        (defn quit [] (System/exit 0))

in your user.clj would also allow you to quit with (user/quit) or just (quit) if the current namespace is user.

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to