<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Well, they run 'bash' basically,  which
      then has a full path, and then feed further commands into the bash
      command. But I don't think running bash is a solution thats
      appropriate for us over in cdk / vagrant. <br>
      <br>
       I still think our tools should be able to handle if the command
      isn't on the path. There's no reason to make that assumption when
      to work around it is so simple.  We simply search the path, which
      finds 95% of the usecases in a very very quick time. And in the
      event it's not on the path, we do the which/where, and this
      command responds almost instantly. <br>
      <br>
      We've already noticed that Mac seems to generate a different path
      based on if you use the .app shortcut or from a terminal. And
      windows users often install things like putty without explicitly
      putting them on the path since they're used to using the binaries
      directly. There seem to be many ways in which the path might be
      incomplete, and it's definitely worth our while to use every
      mechanism available to find them, to help our users and make our
      tools work OOTB. <br>
      <br>
      Anyway, again,  we only run the search logic once per workspace
      session. In 95% of the cases it responds extremely fast. In the
      event the binary isn't found on the path, the simple which/where
      runs, and also returns extremely quickly... and this is done only
      once per workspace. I can't even notice a delay honestly. <br>
      <br>
      On 12/08/2015 03:00 PM, Max Rydahl Andersen wrote:<br>
    </div>
    <blockquote
      cite="mid:1DFB20F9-DCF3-4F0D-9EA7-2501030F7756@redhat.com"
      type="cite">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div>Rob,</div>
      <div id="AppleMailSignature"><br>
      </div>
      <div id="AppleMailSignature">Is the Tty issue not separate from
        the way they use to locate the right way to run. </div>
      <div id="AppleMailSignature"><br>
      </div>
      <div id="AppleMailSignature">I.e. They assume user has vagrant on
        path. Removing all need for doing custom which/where etc. <br>
        <br>
        <br>
        /max
        <div><a moz-do-not-send="true"
            href="http://about.me/maxandersen">http://about.me/maxandersen</a></div>
        <div><br>
        </div>
      </div>
      <div><br>
        On 08 Dec 2015, at 20:34, Gorkem Ercan &lt;<a
          moz-do-not-send="true" href="mailto:gercan@redhat.com"><a class="moz-txt-link-abbreviated" href="mailto:gercan@redhat.com">gercan@redhat.com</a></a>&gt;
        wrote:<br>
        <br>
      </div>
      <blockquote type="cite">
        <div>
          <div dir="ltr">
            <div><br>
            </div>
            I guess you can deal with /dev/tty. Perhaps something like
            "sh -l less &gt;/dev/tty" would work (I have not tried it
            though)<br>
          </div>
          <div class="gmail_extra"><br>
            <div class="gmail_quote">On Tue, Dec 8, 2015 at 1:40 PM, Rob
              Stryker <span dir="ltr">&lt;<a moz-do-not-send="true"
                  href="mailto:rob.stryker@jboss.com" target="_blank">rob.stryker@jboss.com</a>&gt;</span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div text="#000000" bgcolor="#FFFFFF">
                  <div>OK, so, tl;dr is it seems you're using
                    Debug.exec(etc) to launch the command, in this case
                    bash,  which then gives you an IProcess. You feed
                    further input into the IProcess to get the desired
                    result, and I'm assuming you wire in the console
                    support on your own via stream listeners. <br>
                    <br>
                    <br>
                    So you're not using any of org.eclipse.tm.terminal
                    stuff.  <br>
                    <br>
                    I've played with your utility class <a
                      moz-do-not-send="true"
href="https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/util/ExternalProcessUtility.java"
                      target="_blank"><a class="moz-txt-link-freetext" href="https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/util/ExternalProcessUtility.java">https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/util/ExternalProcessUtility.java</a></a> 
                    and it also seems to not function if the process
                    being run is expecting the caller to be a TTY
                    terminal (specifically, vagrant up for cdk2b3 not
                    from the openshift-vagrant repo but the standard
                    distribution). <br>
                    <br>
                    It seems to me that Runtime.exec(etc), 
                    Debug.exec(etc),  the external tools launch
                    configuration, and all other solutions are incapable
                    of being treated as a tty. Only the
                    org.eclipse.tm.terminal stuff is capable of
                    implementing the additional requirements to be
                    treated as a tty...  however, I feel that using
                    o.e.tm.terminal on a more regular basis is
                    misguided.  For the first part, it becomes difficult
                    to read its output.  The user can suddenly get
                    involved in the process by typing things in at
                    inopportune moments. It is impossible to use without
                    the UI, so can't be done in the background, as well
                    as a number of other issues that come as
                    consequences of those. <br>
                    <br>
                    In short, it seems applications requiring a TTY
                    environment are really not that many, and the fact
                    that vagrant-registration requires it at all is very
                    strange. It most likely needs the TTY functionality
                    to accept a password without showing it, but I can't
                    seem to figure out if thats just a guess or not. <br>
                    <br>
                    Either way, I'm going to stick with our current way
                    of doing things, either via Runtime.exec when we
                    want it in the background, ro external-tools launch
                    config when we want the command's output to be shown
                    in a console. <br>
                    <span class="HOEnZb"><font color="#888888"> <br>
                        - Rob</font></span>
                    <div>
                      <div class="h5"><br>
                        <br>
                        <br>
                        On 12/08/2015 08:02 AM, Gorkem Ercan wrote:<br>
                      </div>
                    </div>
                  </div>
                  <div>
                    <div class="h5">
                      <blockquote type="cite">
                        <div dir="ltr">
                          <div>
                            <div>
                              <div>
                                <div><br>
                                </div>
                                For Node.js based tools we needed a
                                fully configured PATH because it is
                                often the case those tools will make
                                calls to other apps. <br>
                              </div>
                              Basically our strategy is to start a full
                              bash/cmd shell (notice -l for bash) which
                              will be configured fully. [1] <br>
                              then execute the commands [2]<br>
                            </div>
                            <div>finally issue an exit to leave the
                              shell [3]<br>
                              <br>
                            </div>
                            <div>The only downside is you can not easily
                              capture the process exit code.<br>
                              <br>
                            </div>
                            <div>The code examples are from the initial
                              implementation that I have done for
                              CordovaCLI and uses eclipse libraries for
                              starting the process however it can be
                              implemented equally same using the
                              Runtime.exec too. [4]<br>
                            </div>
                            <div><br>
                              <br>
                              [1] <a moz-do-not-send="true"
href="https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/cordova/CordovaCLI.java#L175"
                                target="_blank">https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/cordova/CordovaCLI.java#L175</a><br>
                              [2] <a moz-do-not-send="true"
href="https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/cordova/CordovaCLI.java#L135"
                                target="_blank">https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/cordova/CordovaCLI.java#L135</a><br>
                              [3] <a moz-do-not-send="true"
href="https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/cordova/CordovaCLI.java#L139"
                                target="_blank">https://github.com/gorkem/thym/blob/use_cli/plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/internal/cordova/CordovaCLI.java#L139</a><br>
                            </div>
                            [4] <a moz-do-not-send="true"
href="https://github.com/gorkem/js-parser-benchmarks/blob/master/src/main/java/org/jboss/tools/benchmark/parsers/esprima/EsprimaParser.java#L70"
                              target="_blank">https://github.com/gorkem/js-parser-benchmarks/blob/master/src/main/java/org/jboss/tools/benchmark/parsers/esprima/EsprimaParser.java#L70</a><br>
                            --<br>
                          </div>
                          Gorkem<br>
                          <div>
                            <div class="gmail_extra"><br>
                              <div class="gmail_quote">On Tue, Dec 8,
                                2015 at 2:09 AM, Max Rydahl Andersen <span
                                  dir="ltr">&lt;<a
                                    moz-do-not-send="true"
                                    href="mailto:manderse@redhat.com"
                                    target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:manderse@redhat.com">manderse@redhat.com</a></a>&gt;</span>
                                wrote:<br>
                                <blockquote class="gmail_quote"
                                  style="margin:0px 0px 0px
                                  0.8ex;border-left:1px solid
                                  rgb(204,204,204);padding-left:1ex">
                                  <div dir="auto">
                                    <div>Question relevant on the list. <br>
                                      <br>
                                      /max
                                      <div><a moz-do-not-send="true"
                                          href="http://about.me/maxandersen"
                                          target="_blank">http://about.me/maxandersen</a></div>
                                      <div><br>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <div><br>
                                          On 08 Dec 2015, at 05:09, Rob
                                          Stryker &lt;<a
                                            moz-do-not-send="true"
                                            href="mailto:rob.stryker@jboss.com"
                                            target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:rob.stryker@jboss.com">rob.stryker@jboss.com</a></a>&gt;

                                          wrote:<br>
                                          <br>
                                        </div>
                                        <blockquote type="cite">
                                          <div>
                                            <div>Hey Guys:<br>
                                              <br>
                                              Can you clarify how you
                                              guys call filesystem
                                              commands like npm and
                                              cordova? <br>
                                              <br>
                                              In the CDK tools as
                                              currently coded, we do two
                                              different things.  One, is
                                              that we create an
                                              "External Tools Launch
                                              Configuration" which runs
                                              the command. This requires
                                              knowing the actual
                                              location of the
                                              executable.  The other is
                                              to simply call
                                              Runtime.exec(etc) and get
                                              a Process from it. <br>
                                              <br>
                                              The external tools launch
                                              config is useful because
                                              it opens a console for us
                                              and means we don't have to
                                              do any of the wiring, so
                                              we use that when we know
                                              we want the commands to be
                                              visible to the user. We
                                              use the runtime.exec() in
                                              the background for
                                              commands that we want to
                                              run without showing the
                                              user (for example if we
                                              did a vagrant adbinfo)<br>
                                              <br>
                                              How do you all do it?<br>
                                              <br>
                                              - Rob Stryker<br>
                                              <br>
                                              <br>
                                              On 12/03/2015 11:36 AM,
                                              Max Rydahl Andersen wrote:<br>
                                            </div>
                                            <blockquote type="cite">
                                              <p>In <a
                                                  moz-do-not-send="true"
href="https://github.com/jbosstools/jbosstools-openshift/pull/831#discussion_r46575476"
                                                  target="_blank">plugins/org.jboss.tools.openshift.cdk.server/src/org/jboss/tools/openshift/cdk/server/core/internal/CDKConstantUtility.java</a>:</p>
                                              <pre style="color:rgb(85,85,85)">&gt;          public static String getVagrantLocation() {
&gt; -                return VAGRANT_LOCATION_LINUX;
&gt; +                return findVagrantLocation();
</pre>
                                              <p>im wondering if we are
                                                better of launching this
                                                similar to what <a
                                                  moz-do-not-send="true"
href="https://github.com/gercan" target="_blank">@gercan</a> and <a
                                                  moz-do-not-send="true"
href="https://github.com/ibuziuk" target="_blank">@ibuziuk</a> been
                                                doing for npm and
                                                cordova cli tools.</p>
                                              <p>i.e. call out via bash
                                                or cmd.exe making it up
                                                to the user to have it
                                                properly configured in
                                                PATH</p>
                                              <p
                                                style="font-size:small;color:rgb(102,102,102)">—<br>
                                                Reply to this email
                                                directly or <a
                                                  moz-do-not-send="true"
href="https://github.com/jbosstools/jbosstools-openshift/pull/831/files#r46575476"
                                                  target="_blank">view
                                                  it on GitHub</a>.<img
                                                  moz-do-not-send="true"
                                                  alt=""
src="https://github.com/notifications/beacon/AAmeb6mIhPgXeM33fzWC8KQs43GH6aibks5pMGbygaJpZM4Gtp6v.gif"
                                                  height="1" width="1"></p>
                                              <div>
                                                <div> </div>
                                              </div>
                                            </blockquote>
                                            <br>
                                          </div>
                                        </blockquote>
                                      </div>
                                    </div>
                                  </div>
                                </blockquote>
                              </div>
                              <br>
                            </div>
                          </div>
                        </div>
                      </blockquote>
                      <br>
                    </div>
                  </div>
                </div>
              </blockquote>
            </div>
            <br>
          </div>
        </div>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>