Tweak REPL behaviour, and listen on 0.0.0.0

This commit is contained in:
Tony Garnock-Jones 2011-10-27 15:50:18 -04:00
parent ae9a751ed3
commit 5e742fbc8d
1 changed files with 5 additions and 2 deletions

View File

@ -88,14 +88,17 @@
(sandbox-error-output out)
(current-namespace (make-empty-namespace)))
(parameterize ((current-eval (get-user-evaluator username)))
(eval `(define say ,(lambda (utterance) (send handle say utterance) (void))))
(eval `(define say ,(lambda (utterance)
(printf " You: ~a\n" (->string/safe utterance))
(send handle say utterance)
(void))))
(call-with-interaction-prompt-read handle read-eval-print-loop))
(fprintf out "\nGoodbye!\n")
(close-input-port in)
(close-output-port out)))
(define (t-server)
(define s (tcp-listen 2322 4 #t "localhost"))
(define s (tcp-listen 2322 4))
(printf "Accepting...\n")
(tcp-pty-ssh-server s repl-shell #:prompt *prompt*))