[
https://issues.jboss.org/browse/JBIDE-23039?page=com.atlassian.jira.plugi...
]
Rob Stryker commented on JBIDE-23039:
-------------------------------------
I've reverted the patch in master as well. Few things to note:
1) The '/usr/bin/script' hack does not work on mac. Their version of script does
not accept passing a command without setting an output file, and it's different
overall. Also if script is missing for some reason, it won't work. Altogether, this
was a weird hack to begin with.
2) I spoke with Doug Schaefer to find out what else could be on offer to help solve this.
He pointed to cdt's class "Spawner" and it's associated class
"ProcessFactory". In short, these classes allow CDT to emulate a TTY (ie run a
PTY) when launching the process. However, whether I used the generic console window or
the terminal window, it would still error out with the same problem.
I'm sure CDT has solved this issue in the past, but this will require actually finding
some CDT guys to talk to and see what the problem is and whether my suggested code was
doing something wrong. There won't be a quick fix here unless we get really lucky.
3) Doug recommends we try to find out exactly where vagrant or the various vagrant plugins
are demanding a TTY, and see if we can get them to use standard input instead. There's
no real reason for most processes nowadays to require a TTY when all they are really
looking for is the user to type stuff in via standard-in. This really should be
investigated deeply, first bc it seems to be a strange and unnecessary requirement, but
second because it's actively blocking our tools.
Need an interactive terminal that fits specific requirements
------------------------------------------------------------
Key: JBIDE-23039
URL:
https://issues.jboss.org/browse/JBIDE-23039
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Components: server
Affects Versions: 4.4.1.AM2
Reporter: Rob Stryker
Assignee: Rob Stryker
Fix For: 4.4.2.AM1
Attachments: vagranttty.png
CDK Tools requires a terminal that allows interactivity of i/o. The full set of
requirements is a bit difficult to find a solution for.
1) I must be able to get a Process or IProcess object when a command is run
2) I must be able to get an event or know when the process terminates
3) The terminal or console must be interactive and allow user input when prompted.
4) It must behave as in 3) for 'vagrant' commands and any and all associated
plugins.
These three requirements thus far seem impossible to solve. Solutions that have been
attempted are:
1) Creating a java Process by myself via Runtime.exec. The interactive prompts never
arrive and there is no API for Process to know when it is waiting for input.
2) Using the external-tools launch configuration. When running a command like mvn, the
console that pops up seems to allow input from the user, and functions as expected.
However, when running a command such as vagrant, such prompts are not provided. In our
usecase, the following behavior is observed:
a) During vagrant-registration prompts, the console indicates it is not a TTY terminal
and cannot allow input
b) During a landrush prompt for superuser status, no prompt is made, no TTY message is
listed, and the process appears to have frozen
3) Launching / Opening a tm.terminal view. This solution fails requirements 1 and 2. We
are not able to get a Process or an IProcess when a command is launched in a proper
interactive terminal. This means we can have no way to know when the process has
completed.
Other options have been explored but ended up at dead ends and not worth mentioning. The
real question is why interactive behavior is visible when using external-tools launch
config for maven, but is not visible when running vagrant.
Is this a function of the way the vagrant commands display or prompt for input? Why does
vagrant-registration require a TTY terminal, but maven does not? Is this something that
can be fixed upstream?
No other obvious solutions have presented themselves in the past year.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)