mabe02 / lanterna

Java library for creating text-based GUIs
GNU Lesser General Public License v3.0
2.23k stars 243 forks source link

How can I use the windows cmd as a terminal #538

Open karelantonio opened 3 years ago

karelantonio commented 3 years ago

..?

karelantonio commented 3 years ago

Sorry. I didn't explain well. I want to use another terminal because I use too Termux in Android but when I use it there are some problems because Android doesn't support Java.awt or javax.swing so I use the unixTerminal. But there's another problem. When I use in Termux showsome words (like ^[[...) And when I type something writes over the windows, buttons, etc. I think the problem is related with something like cbreak in curses or maybe some terminals don't support curses at all (or just a part of it). Please tell me what can I do

avl42 commented 3 years ago

windows cmd just isn't a unixterminal. It doesn't behave like one.

There is some experimental code in lanterna to attempt to use windows cmd window nevertheless, but you'll have to experiment with it yourself, and see how you can get it compiled... you might need some third party lib (jna).

In your app then you have to use the DefaultTerminalFactory, rather than instanciating a UnixTerminal directly. The DefaultTerminalFactory will try to find out what Terminal class to use for each respective OS environment at runtime...