Running commands


#1

Are there any examples of packages that run commands? Do we have an output pane where we can output command results?


Easy way to reuse other plugins in your own plugins
#2

You can see the console ⌘ + ⌥ + I like in Chrome.
Or on the menu View > Developer > Toggle Developer Tools


#3

The symbols view package runs the ctags command: https://github.com/atom/symbols-view/blob/master/lib/tag-generator.coffee

The settings view package runs the apm command: https://github.com/atom/settings-view/blob/master/lib/package-manager.coffee

There is no built-in view for output but you could add a view to add to display it.

Node’s ChildProcess is included and you can do require 'child_process' from your package to spawn/fork new command/processes.


#4

Thanks @kevinsawicki! I will definitely look into it.


#5

How do you type the symbol for command and alt? Sorry for OT.


#6

Some of us have put together a package called script that runs scripts (or selections) using BufferedProcess.

It wouldn’t be too bad to use the same kind of setup to run an arbitrary command.

  1. Create a view that drops from the top via a keybinding
  2. User types in their command, hits enter
  3. Create a BufferedProcess that populates in some side view (or bottom, etc.).

Make sure to set the options you use with BufferedProcess

options =
  cwd: atom.project.getPath()
  env: process.env

Honestly though, maybe I could just put it into the script package as cmd-r to run an arbitrary command in the same window. That would keep the UX/UI unified.