[jbosstools-issues] [JBoss JIRA] (JBIDE-23039) Need an interactive terminal that fits specific requirements

Roland Grunberg (JIRA) issues at jboss.org
Thu Aug 25 12:41:00 EDT 2016


    [ https://issues.jboss.org/browse/JBIDE-23039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284429#comment-13284429 ] 

Roland Grunberg edited comment on JBIDE-23039 at 8/25/16 12:40 PM:
-------------------------------------------------------------------

Am I right in assuming that for the terminal.tm viewer, you are using a "org.eclipse.tm.terminal.connector.process.launcher.process". This would be the one where you're providing the path of the command along with arguments through the properties. In this case, yes I don't immediately see a way of getting the Process.

However, you could try using a "org.eclipse.tm.terminal.connector.streams.launcher.streams" delegate. This is what the Eclipse Docker Tooling does. In our case we don't want to launch some command, we just want to take care of that ourselves, and just pass a input/output streams to the terminal service.

So you would :

1) Launch the process however you like (eg. Runtime.getRuntime().exec(..), which gives you (1), access to the IProcess/Process, and (2), a way to check when it has terminated.
2) Pass the output/input streams from the Process as properties to the "org.eclipse.tm.terminal.connector.streams.launcher.streams" delegate. I believe they are ITerminalsConnectorConstants.PROP_STREAMS_STDIN, and ITerminalsConnectorConstants.PROP_STREAMS_STDOUT. Have a look at http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.git/tree/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java#n1962 .


was (Author: rgrunber):
Am I right in assuming that for the terminal.tm viewer, you are using a "org.eclipse.tm.terminal.connector.process.launcher.process". This would be the one where you're providing the path of the command along with arguments through the properties. In this case, yes I don't immediately see a way of getting the Process.

However, you could try using a "org.eclipse.tm.terminal.connector.streams.launcher.streams" delegate. This is what the Eclipse Docker Tooling does. In our case we don't want to launch some command, we just want to take care of that ourselves, and just pass a input/output streams to the terminal service.

So you would :

1) Launch the process however you like (eg. Runtime.getRuntime().exec(..), which gives you (1), access to the IProcess/Process, and (2), a way to check when it has terminated.
2) Pass the output/input streams from the Process as properties to the "org.eclipse.tm.terminal.connector.streams.launcher.streams" delegate as properties. I believe they are ITerminalsConnectorConstants.PROP_STREAMS_STDIN, and ITerminalsConnectorConstants.PROP_STREAMS_STDOUT. Have a look at http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.git/tree/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java#n1962 .

> 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
>
> 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)


More information about the jbosstools-issues mailing list