CondorLang / Condor

A fast, simple, and intelligent new programming language
BSD 3-Clause "New" or "Revised" License
34 stars 11 forks source link

Fix Shell Up, Down, Left, and Right Arrow #15

Open chaseWillden opened 7 years ago

chaseWillden commented 7 years ago

When running ./build/condor, running in shell mode, the usage of the left, up, down, and right arrow does not work. The symbol [^A or something like that appear.

Berkmann18 commented 7 years ago

That kind of situations is quite common when trying to type a keystroke (in your case arrow keys) since it shell's thread is in blocked mode (whether it's on the kernel or user level) and that any input would still be registered as being "seen" but since the standard input of the shell isn't working while this is happening, the shell output characters such as [^A, [^B or any character sequences that would satisfy this regexp: /^[^[A-Za-z]$/.

In order to fix that, it would be adviseable to check the thread level of the shell (so either user or kernel) and to see the state (running, ready or blocked) of that shell during the period at which you're trying to input arrow keys and to make the appropriate changes to make it respond the way you want.

chaseWillden commented 7 years ago

Do you want to make a pull request with a suggested fix?