How to call external tools and use windowed (non-console) result


#1

Hi,

I’m starting to create a TFS (Team Foundation Version Control) package, and to do so, I use tf.exe console application. I’m using child_process.spawn to call it, but doing so, the result is always the console interface, instead of the visual. For instance, when I do

command = 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\tf.exe'
args = ["history", filePath]
history = spawn(command, args)

I can get the results with

history.stdout.on "data", (data) ->
  console.log "stdout: " + data

But, in this case (history argument), I would like to show the visual interface that tf.exe provides, instead of intercepting the stdout and doing it myself inside Atom.

The history argument has a /noprompt parameter, but I’m not using it.

I don’t know if this is possible (call windowed app using child_process) or if I should use another API. I’m sorry, but my experience with js/cs/node is basically from using and developing small packages for Atom :smile:

Thanks in advance


#2

There are various Atom packages with “console” or “term” in their names, and these would allow you to do this on Unix. But whether it works on Windows, I don’t know. Maybe you can search the package listing for these packages and then see if any one says it works on Windows.


#3

This looks relevant:

And this looks interesting, though I don’t know whether it works on Windows:

Does this help?


#4

Thanks @kgrossjo,

I dig a little on available packages, and on these two that you posted, but unfortunately none have what I’m looking :disappointed_relieved:.

I will try a little bit more, and post here if I have success. Otherwise, I will have to learn how to use List Group or Select List, but then the package should take a bit longer to be published :smile:.

Thanks again


#5

Hi @kgrossjo,

I was wrong, and the https://atom.io/packages/visualstudio-terminals package had the solution. I just ignored one parameter on exec call, that at first sight, appeared to be unnecessary :smile: .

So, doing like below, worked perfectly:

folder = path.dirname(filePath)
cmdline = "\"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\tf.exe\" history \"#{filePath}\" "
exec "start \"history tfs\" " + cmdline, cwd: folder

The parameter that I ignored was \"history tfs\" that is the title to display in window title bar,

Thanks again for your help


#6

Hi,

Any progress with the TFS package - would be great to interact with TFS via Atom.

Cheers,
Chris