libera/#slime - IRC Chatlog
Search
17:11:57
dieggsy
is it possible to redirect all output to the repl buffer? that is, see output as you might when running lisp on the command line
18:30:02
pjb
dieggsy: the problem is that other threads may still use their own copy of the special variables, with their own bindings to the original *terminal-io* (ie. *inferior-lisp*), as well as closures having obtained their threads before swank was initialized.
18:31:04
pjb
Try: (list *standard-input* *standard-output* *error-output* *trace-output* *terminal-io* *query-io* *debug-io*)
18:32:50
pjb
see also: (swank:*default-worker-thread-bindings* SWANK:*MACROEXPAND-PRINTER-BINDINGS* SWANK::*INSPECTOR-VERBOSE-PRINTER-BINDINGS* SWANK::*INSPECTOR-PRINTER-BINDINGS* swank::*backtrace-printer-bindings* #+#.(cl:if (cl:find-symbol "*SLDB-PRINTER-BINDINGS*" "SWANK") '(:and) '(:or)) swank:*sldb-printer-bindings*)
18:33:19
pjb
You could add binding for all those stream variables to those swank bindings variables to force them on all swank stuff.
18:34:18
dieggsy
er, whoops, i tested in slynk and not slime, i have them side by side. in any case they pretty much do the same thing in this regard
18:34:41
pjb
But of course, you cannot do that in .swank.lisp, but after swank is started once you have the slime-stream instances.
18:35:22
pjb
In *inferior-lisp*, *terminal-io* is #<ECHOING-TWO-WAY-STREAM input #<BASIC-CHARACTER-INPUT-STREAM UTF-8 (PIPE/0) #x3020003BE5DD>, output #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/1) #x3020003BE14D> #x3020003C386D> (and the others should be synonym-streams to it).
18:35:43
pjb
in the slime repl, you have #<swank/gray::slime-input-stream #x30200200D2BD> #<swank/gray::slime-output-stream #x30200200CF2D> and two-way-streams combining them.
18:37:39
dieggsy
hm. I'll look into this when i have a bit more time to fiddle around with it. thank you!