I have an interactive command line program, that has tab completion feature (completes the command or list possible options) when tab key is pressed.
I'm writing another Java program, that will launch the command line program as a child process with ProcessBuilder.
I'm able to pass the input to the process using Process.getInputStream()
and Process.getOutputStream()
.
Now, I want to trigger the auto completion in the child process. When I print the tax character '\t'
, it is treated as a regular tab character, instead of triggering the tab auto completion.
Is there a way to send key press or equivalent event from a Java process to a child process?