Sergix / JTerm

A terminal written in Java for cross-platform compatibility and usage.
https://sergix.github.io/projects/jterm
GNU General Public License v3.0
52 stars 32 forks source link

Use previous commands #47

Closed nanoandrew4 closed 7 years ago

nanoandrew4 commented 7 years ago

Lets you rotate through previously entered commands, so that they can be reused.

nanoandrew4 commented 7 years ago

Currently the command line does not interpret arrow keys at all. I just pushed some experimental code that works in Linux, but might not in Windows, if anyone can give it a spin and check that it outputs "up", "left", "right" and "down" for the respective keys, that would be greatly appreciated.

Commit with experimental code: 6c3cba17161cc4de5d30846f601c5c1b5755bbee

Sergix commented 7 years ago

Ah, I didn't even consider command scrolling. Good thinking!

But as of now, my input isn't reading any characters at the input prompt at all...

nanoandrew4 commented 7 years ago

It's not supposed to, it's test code. See if the arrow keys on your keyboard work, all other input is blocked.

On Oct 5, 2017 18:17, "Sergix" notifications@github.com wrote:

Ah, I didn't even consider command scrolling. Good thinking!

But as of now, my input isn't reading any characters at the input prompt at all...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Sergix/JTerm/issues/47#issuecomment-334594725, or mute the thread https://github.com/notifications/unsubscribe-auth/ANsyiMhgCA_XRMH1ZwDR-38oNaCQhDhiks5spUdOgaJpZM4PvUev .

Sergix commented 7 years ago

Ohohoh. My bad. :rofl:

Sergix commented 7 years ago

But no, I don't believe it works on my machine. When I press the arrow keys nothing happens. The expected output is to print the arrow key being pressed, correct?

nanoandrew4 commented 7 years ago

Yes that should be the output. I will check to see what Windows is interpreting it as...

Edit: Pull request is still open... Is there an issue you have run into with the code?

Sergix commented 7 years ago

The PR is still open because your current commits with the arrow key testing are being included in that PR.

nanoandrew4 commented 7 years ago

Do you want me to remove that push so it can be merged or just take down the request and make a new one when this is implemented?

Sergix commented 7 years ago

No, I'll just wait for the issue to be completed.

nanoandrew4 commented 7 years ago

@Sergix I checked the pull request and it does not include the experimental code, all three commits that form part of the pull request are all working code that has been tested. I re-opened it for it to be merged, if everything is still fine as it was when issue #32 was closed.

Sergix commented 7 years ago

In the current PR, it still shows that InputHandler.java has the test code: https://github.com/Sergix/JTerm/pull/46/files#diff-43ec57f4d6646bf342fb6beef3f03da9

nagharajan commented 7 years ago

Hi,

I have modified InputHandler and JTerm for command rotation. Would someone like to take a look? This is my first attempt at open source working. So all guidance in reviewing the code and help me check-in will be appreciated. thanks.

nanoandrew4 commented 7 years ago

@nagharajan I would gladly take a look at the code! I looked at your GitHub page and there is no fork... Where can the code be found?

Sergix commented 7 years ago

This issue is still in progress, correct?

nanoandrew4 commented 7 years ago

Should be fixed with my latest commit but... Last I checked everything was broken, do the arrow keys even work?

I have it all working and pretty in my other project, would you like me to adapt the input handling code over?

Sergix commented 7 years ago

If you can, sure! :)

By the way, I took a look at your other project. It looks really great! :D

nanoandrew4 commented 7 years ago

Thanks 😇 doesn't do much yet, trying to iron out all those pesky bugs that plague the input and autocomplete. I'll close my PR and open a new one when the code is merged, probably tomorrow or Monday when I finish ironing out the autocomplete which is failing for some odd reason...

nanoandrew4 commented 7 years ago

Just finished cleaning up the code and testing, all is good on Unix at least.

I will start transplanting my code to this project, making sure to try not to upset any Windows code...

Sergix commented 7 years ago

Sounds good! 👍

And it's interesting how we have to worry about platform-dependency on what's supposed to be a platform-independent executable. Too bad Java doesn't have more native libraries. 😜

nanoandrew4 commented 7 years ago

The wonders of writing platform-dependent code... It is too bad Java does not do the heavy lifting on that end, but it is what you get for trying to make a terminal program xD. Of course, a lot of the platform dependence could be dropped if you just reverted back to line by line input. Oh what we do for you, autocomplete....

Sergix commented 7 years ago

Haha! So very true. 🤣

nanoandrew4 commented 7 years ago

PR #78 should close this issue.