Keno / REPL.jl

Pure-julia REPL implementation
Other
3 stars 4 forks source link

hitting enter does not produce a newline #15

Closed StefanKarpinski closed 10 years ago

StefanKarpinski commented 10 years ago

Instead it advances the cursor a single space. I'm using iTerm2 but the same thing happens in Terminal; I'm not sure if I have weird key bindings (I do have things setup so that enter and alt-enter behave differently).

Keno commented 10 years ago

Can you try adding

        '\n' => '\r',

in Readline.jl after line 802 and tell me if that fixes it.

StefanKarpinski commented 10 years ago

It does not. Note that I have it setup so that one of enter or alt-enter sends \n while the other sends \r but neither one works – they both produce a space. Any more helpful debugging I can do? Maybe a println somewhere that will show what character the library is getting?

StefanKarpinski commented 10 years ago

Oh, some interesting behaviors:

  1. If run an input all on a single line (apparently), and then up-arrow to get the previous input back, it's got a newline.
  2. I hit enter and get a space, then I enter more text and hit enter again, the formatting of the whole thing becomes correct including the newlines I wanted in the first place.

If you want, I can ssh to julia.mit.edu and allow you to tunnel to log into my machine.

StefanKarpinski commented 10 years ago

If you want to do that, just send me an SSH public key over email and I'll add you to the authorized keys file.

ViralBShah commented 10 years ago

Hitting enter does produce a new line for me in the terminal.

carlobaldassi commented 10 years ago

I confirm the buggy behaviour reported by Stefan in every detail, and I'm on linux using gnome-terminal.

Keno commented 10 years ago

I'm able to reproduce now. Working on a fix.

Keno commented 10 years ago

Fixed in Readline.jl

carlobaldassi commented 10 years ago

I just did a Pkg.update and now when I input an incomplete expression (e.g. for i=1:3) and press enter it just takes the line:

julia> for i=1:3
ERROR: syntax: incomplete: premature end of input

Also, ctrl-enter does not work (has the same effect as enter). Still on linux 64bit, gnome-terminal.

Keno commented 10 years ago

Fixed.