Re: Java Unix Shell "Simulator"
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Wed, 27 Sep 2006 14:56:05 GMT
"Thomas Weidenfeller" <nobody@xxxxxxxxxxxxxxxx> wrote in message news:efd9t1$ai3$1@xxxxxxxxxxxxxxxxxxxxxxxxx
andrevcunha@xxxxxxxxx wrote:I know that have some stuffs to send commands and "read" output, but a
need for something that only unix shell can do, like press the TAB key
to complete the word, etc etc.
You can't in a good general way in Java alone. Java lacks the necessary access to terminal features. E.g. you can't switch standard input to unbuffered character input from within Java. You will have to use native, platform dependent code.
Do you know any thing that can help me?!
Don't do it. Use a real shell.
The OP later on mentions that they're implementing a GUI app using SWT to implement this shell. So in the absolute worst case, the OP could just register a keyboard listener to detect every keypress, and do pixel-by-pixel custom rendering to do whatever it is they need to do. The question is whether there might be a better way. For example, the OP might use a textbox instead of custom rendering, but the textbox might have specific behaviour with respect to the cursor, the arrow keys, the tab key, etc. which will "ruin" the illusion that the user is using a unix shell.
- Oliver
.
- References:
- Java Unix Shell "Simulator"
- From: andrevcunha
- Re: Java Unix Shell "Simulator"
- From: Thomas Weidenfeller
- Java Unix Shell "Simulator"
- Prev by Date: jboss 3.2.5 and eclipse 3.2 wtp 1.5
- Next by Date: Re: Convert from int to char
- Previous by thread: Re: Java Unix Shell "Simulator"
- Next by thread: Checbox help!!!
- Index(es):
Relevant Pages
|