fabianishere/brainfuck

Espace sequences instead of cursor movement

rien333 opened this issue · 4 comments

I'm not sure if this intentional but the interpreter disallows basically any sort of cursor movement, like that with the arrow keys or emacs-like Ctrl-e/Ctrl-a type of stuff. When I try to to for example move my cursor to the right some escape sequence appears on the prompt instead. Any fix on my side or a rationale behind the choice to disable cursor movement ? (macOS 10.12 + iTerm)

Hi, the reason escape characters currently do not work in the interactive mode is that its implementation is really basic (20 lines of code) and therefore does not support movement of the cursor.

There is really no rationale behind this choice other than that I haven't had the time to implement it (plus probably needing a dependency like readline to handle input).

Hm, okay. Maybe I will try to implement it one day. Would you be open for that? And would it be okay to use the readline to achieve cursor movement?

Yes, of course! Although, using readline might be an issue due to its incompatibility with our license (GPL vs Apache), but we could use a replacement like editline to archieve the same functionality.

Fixed in #42