REPL input broken

Description

REPL doesn't handle backspace character correctly, even backing up over the "user=>" prompt, yet apparently not being captured at all during evaluation. Also, this is what happens when I type "clojure " <---space, instead of "*clojure" <----dash, while trying to evaluate "*clojure-version":

$ mono Clojure.Main.exe
Clojure 1.5.0
user=> *clojure CompilerException System.InvalidOperationException: Unable to resolve symbol: *clojure in this context
at clojure.lang.Compiler.ResolveIn (clojure.lang.Namespace n, clojure.lang.Symbol symbol, Boolean allowPrivate) [0x00000] in <filename unknown>:0
at clojure.lang.Compiler.Resolve (clojure.lang.Symbol symbol) [0x00000] in <filename unknown>:0
at clojure.lang.Compiler.AnalyzeSymbol (clojure.lang.Symbol symbol) [0x00000] in <filename unknown>:0
at clojure.lang.Compiler.Analyze (clojure.lang.CljCompiler.Ast.ParserContext pcontext, System.Object form, System.String name) [0x00000] in <filename unknown>:0 , compiling: (NO_SOURCE_PATH:0:0)

...and further input is ignored, requiring ^C to exit.

Environment

ClojureCLR 1.5.0 Release, Ubuntu 14.04, Mono 3.2.8

Activity

Show:
Shlomo Shuck
August 4, 2014, 5:16 AM

Markup mangled my bug report obviously, whoops. I meant that I hit space after asterisk clojure instead of a dash.

David Miller
August 4, 2014, 6:51 AM

This has been a problem on Mono from the beginning.
I've asked several people about it, but I don't have a solution.
I'll put a query up on the mailing list and see if anyone has a suggestion.

Shlomo Shuck
August 5, 2014, 3:38 PM

For what it's worth, a C# REPL comes bundled with Mono which works well. The REPL code is a 900-line program which uses a 1000-line getline library. The latter has no dependencies outside of the System namespace, which is good, but I have no clue as to how it'd work with MS .NET. Anyway, I've attached it for your consideration (path in Ubuntu "mono" package source is mcs/tools/csharp/getline.cs).

David Miller
December 13, 2020, 10:22 AM

commit 997c80c, 2020.10.17.

Fixed

Assignee

David Miller

Reporter

Shlomo Shuck

Labels

None

Approval

None

Patch

None

Priority

Major