How can you get the current caret position in terminal with Java? -


i've looked @ jline, lanterna, , others, i'm not seeing simple way find current caret position in terminal these tools. i've looked @ number of escape codes, tput, etc. but, i'm looking easiest way current column , row caret located java. maybe haven't found right call in these libraries...

what's easiest way row , column of caret in terminal?

i'm looking pure textual library can re-write buffer. i'm aware of ansi escape codes , how manipulate them produce effects i'm after. i'm trying make java prompt library in vain of inquirer.js node. has number of simple ways info user (lists, questions, split lists, etc). of text -- of without ui, , non-swing. don't want swing, want decent terminal ui experience.

edit2

with http://docs.oracle.com/javase/7/docs/api/javax/swing/text/caret.html caret interface, can create caretlistener object in order find caret position.

so have create new caretlistener responds gui, getdot() method.

this might help... code anyway. http://bestjavapractices.blogspot.com.au/2011/11/get-current-caret-position-in.html

now @ moment work on gui/swingcomponents , i'm not sure if work terminal application ,which want, assume using command line arguments , such things work.

i don't think think terminal printing out output, keep checking little while anyway.

if tell me trying use caret in efforts.

hope helps.

if doesn't may need through more text toolkits, such


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -