Setting up environment for interpreted code/interactive shell


#1

I’ve just installed Atom and I’m trying to figure out how to set some things up. I’m mostly interested in doing mathematical computing, so my goal at the moment is setting up an interaction with a terminal shell to evaluate interpreted code (with Python, and with the Magma computer algebra package).

I have seen that there is Term2 to open a terminal window, and there are also packages script (and some related ones). I’m not sure which gives me what I actually need:

  1. I want to be able to open a terminal window using a keyboard shortcut that will launch the relevant interpreter, and automatically import the path from the launching buffer (plus the proper environment variables).
  2. I want to be able to use keyboard shortcuts to send various pieces of code from my text buffer to the interpreter (send a selection, block, entire file, up to cursor location… or at least some of these options)
  3. Ideally, I could also type code directly into the shell, send interrupt commands, etc.

It doesn’t seem like any of the three packages I mentioned can be set up in this way, though I may be mistaken. script seems to terminate the shell as soon as the code is evaluated, and I can’t figure out how to automate passing input to Term2. Any advice on which of these three I want to start with? And maybe tips on how to configure for my purposes?


#2

So far the best option I have been able to find is the termrk package. It’s not perfect, but I can open up a(n emulated) terminal pane in Atom, in my current working directory if desired, and then I can send it selected snippets of code to evaluate.

I’ll probably keep looking at other options in the meantime, and also will maybe give some input this package. In some ways, it would be ideal to be able to actually launch Terminal (ie not in an Atom pane) and have there be some interaction in terms of sending code!

Does anyone else have a setup they like for this type of thing? For me, options like script and script-runner don’t work because I need interactivity, or at the VERY least I need my interpreter to stay open after evaluating some code and wait for me to send another block.