This package is a fork of the popular
atom-runner but with many PRs merged and other issues fixed. It includes support for shebang lines (
#!), correctly setting the environment (e.g.
RVM supported out of the box) and proper terminal emulation using pty.js and xterm. Many thanks to Loren Segal and all the contributing developers.
N.B. these keyboard shortcuts are currently being reviewed, input is welcome.
|Command||Mac OS X||Linux|
Scripts which have been saved run in their directory, unsaved scripts run in the workspace root directory.
The Run: Script command is used script-runner will check if there is already an output view dedicated to the script in the text editor in focus. If there isn't one a new one will be created otherwise it will clear the already existing one and reuse it.
Closing a runner view will cause its process to terminate to avoid losing control over scripts executed with this plugin.
If you get issues about loading node-pty, you might have a problem with your python install.
node-gyp doesn't work if
python points to
python3. To fix this, tell
apm to prefer python2.7
apm config set python $(which python2.7)
Once you've done this, reinstall script-runner.
When invoking the above
Run: Script command, if a portion of the script is selected, only that portion will be executed.
When running a script, the focus will be passed to the script output terminal. You are welcome to use the keyboard and mouse to interact with the running program.
In a typical UNIX environment, the shebang line specifies the interpreter to use for the script:
#!/usr/bin/env rubyputs "Hello World"
The shebang line is the preferred way to specify how to run something as it naturally supports all the intricacies of your underlying setup, e.g. Ruby's
Even for unsaved files without an associated grammar, as long as you have the correct shebang line it will be executed correctly.
The default Atom process takes environment variables from the shell it was launched from. This might be an issue if launching Atom directly from the desktop environment when using, say, RVM which exports functionality for interactive terminal sessions.
To ensure consistent behavior, when running a script, environment variables are extracted from the interactive login shell. This usually loads the same environment variables you'd expect when using the terminal.
It is possible to configure which way to split the new pane. Open your Atom config file and edit
'script-runner'.splitDirection, the possible
'right'. For example:
To limit the number of lines kept in the output window simply edit the
'script-runner'.scrollback option in
your Atom config file.
git checkout -b my-new-feature)
git commit -am 'Add some feature')
git push origin my-new-feature)
Released under the MIT license. Please see
LICENSE.md for the full license.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.