Skip to content
This repository

REPL hangs after invalid character #126

Open
mtnygard opened this Issue · 2 comments

3 participants

Michael Nygard Sergei Lebedev ghachey
Michael Nygard

I hit up-arrow in the REPL, thinking it had JLine support. Submitting the line with a bogus escape sequence results in an error. Following that error, no additional lines will be read. (REPL emits a prompt, but does not respond to any further input.)

one.sample.repl=> 
2012-03-20 13:27:54.985:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
"Type: " :cljs/quit " to quit"
2012-03-20 13:27:54.986:INFO::jetty-6.1.25
2012-03-20 13:27:54.997:INFO::Started SocketConnector@0.0.0.0:8080
ClojureScript:cljs.user> ^[[A 
"Error evaluating:"  :as "cljs.user.\n"
#<SyntaxError: illegal character>
()@http://localhost:8080/javascripts/out/clojure/browser/repl.js:21
evaluate_javascript([object Object],"cljs.core.pr_str.call(null,(function (){var ret__2605__auto____5601 = cljs.user.\x1B;\n\ncljs.core._STAR_3 = cljs.core._STAR_2;\ncljs.core._STAR_2 = cljs.core._STAR_1;\ncljs.core._STAR_1 = ret__2605__auto____5601;\nreturn ret__2605__auto____5601;\n})());\n")@http://localhost:8080/javascripts/out/clojure/browser/repl.js:21
("cljs.core.pr_str.call(null,(function (){var ret__2605__auto____5601 = cljs.user.\x1B;\n\ncljs.core._STAR_3 = cljs.core._STAR_2;\ncljs.core._STAR_2 = cljs.core._STAR_1;\ncljs.core._STAR_1 = ret__2605__auto____5601;\nreturn ret__2605__auto____5601;\n})());\n")@http://localhost:8080/javascripts/out/clojure/browser/repl.js:115
("evaluate-javascript","cljs.core.pr_str.call(null,(function (){var ret__2605__auto____5601 = cljs.user.\x1B;\n\ncljs.core._STAR_3 = cljs.core._STAR_2;\ncljs.core._STAR_2 = cljs.core._STAR_1;\ncljs.core._STAR_1 = ret__2605__auto____5601;\nreturn ret__2605__auto____5601;\n})());\n")@http://localhost:8080/javascripts/out/goog/messaging/abstractchannel.js:141
("evaluate-javascript","cljs.core.pr_str.call(null,(function (){var ret__2605__auto____5601 = cljs.user.\x1B;\n\ncljs.core._STAR_3 = cljs.core._STAR_2;\ncljs.core._STAR_2 = cljs.core._STAR_1;\ncljs.core._STAR_1 = ret__2605__auto____5601;\nreturn ret__2605__auto____5601;\n})());\n","http://localhost:9000")@http://localhost:8080/javascripts/out/goog/net/xpc/crosspagechannel.js:514
([object Object])@http://localhost:8080/javascripts/out/goog/net/xpc/nativemessagingtransport.js:153
([object Object])@http://localhost:8080/javascripts/out/goog/events/listener.js:157
([object Object],[object Object])@http://localhost:8080/javascripts/out/goog/events/events.js:753
(16,[object MessageEvent])@http://localhost:8080/javascripts/out/goog/events/events.js:986
([object MessageEvent])@http://localhost:8080/javascripts/out/goog/events/pools.js:164

nil
ClojureScript:cljs.user> 

In the browser, the app still works. It's just the REPL that stops responding.

Other kinds of errors in the REPL do not seem to cause this. Just the escape sequence.

Sergei Lebedev

The latest version seems to hang on any exception, which is uncomfortable, since the only way out is to restart the REPL.

ghachey

For me its even worse (in fact, I'm not sure I should not open another issue for this). If I go in and out of cljs repl (e.g. (go) -> :cljs/quit -> (cljs-repl)) then I get a pretty useless REPL. I can replicate this (until now) 100% of the time. I run "lein repl" then (go), then out and in cljs REPL. When I continue with the exercise on the Event-dispatching wiki page and try

(in-ns 'one.dispatch) 

followed by

(def alert-reaction
  (react-to #{:test-event} (fn [event-id data] (js/alert data))))

the REPL just stops responding. Only a CRTL-C will make it respond with a java.lang.ThreadDeath error stack trace. From there only a CTRL-D will get me out completely back on the command line and I have to start all over again.

I am using OpenJDK Runtime Environment (IcedTea6 1.11.4) (6b24-1.11.4-1ubuntu0.12.04.1) on Linux Mint (Ubuntu). And I am using a branch of ClojureScript One (M003). The master would not work at all with lein 2 which is another issue of its own.

Thank you,

GH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.