beryx / text-io

A library for creating interactive console applications in Java
http://text-io.beryx.org/
Apache License 2.0
342 stars 45 forks source link

how to prevent cursor from moving #16

Closed mokun closed 5 years ago

mokun commented 5 years ago

Hi,

How do I defensively "fix" the position of the blinking cursor right at the line of the most recent input ?

Currently, the up, down, left, right arrow key can move the cursor key elsewhere on the terminal, which is undesirable, especially that the user may not know that the cursor key needs to be returned to that same spot in order to continue to type the input.

Thanks much for this great API !

siordache commented 5 years ago

@mokun I just released the version 3.2.1.

You are still able to move the caret elsewhere on the terminal, but it now jumps to the end of the line of the most recent input when you start typing. This matches the behavior of the console windows provided by IDEs such as Eclipse or IntelliJ.

Does this fix solve your problem?

mokun commented 5 years ago

@siordache ,

I just tested it. It works well now.

Thanks !