After a disconnect, reconnect long running worker threads that were spawn for instance by C-x C-e in a lisp buffer send their output to the void.
Detailed process to reproduce: 1. start an sbcl 2. (require 'asdf) (asdf:oos 'asdf:load-op 'swank) (setq swank:*globally-redirect-io* t) (setq swank:*global-debugger* t) (setf swank:*use-dedicated-output-stream* nil) (swank:create-server :dont-close t :port 4007) 3. connect from slime 4. from a buffer eval (loop (sleep 5) (print 'hello *trace-output*) (force-output *trace-output*)) 5. disconnect [At this point output should be going to the terminal where sbcl was started which is the case when the above snippet is wrapped in (sb-thread:make-thread (lambda () ...))). Instead it goes to nowhere.] 6. slime-connect again 7. observe that nobody says hello anymore
The attached patch aims to fix this by: * swank.lisp (maybe-call-with-io-redirection): don't CALL-WITH-REDIRECTED-IO if *GLOBALLY-REDIRECT-IO*. Fixes lost output after disconnect, reconnect.
Cheers, Gábor Melis