Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I occasionally ssh into machines that have Mathematica installed. I then operate Mathematica through the command-line interface.

Often, the command-line interface isn't the ideal way to operate Mathematica, but it does have incredible convenience and speed advantages.

Is there a ncurses library (maybe even a 3rd party one) to add additional functionality when accessing Mathematica through ssh?

Edit

List of ideas for additional functionality

  1. Cursor clicking support, so I don't have to use the arrow keys
  2. Ability to rerun command (Shift+Enter)
  3. Support for Save As
share|improve this question
    
My hunch is no, although you might get hopefully better answers than that or workarounds, if you explain what additional functionality you are looking for. If it's for plotting, there's an answer on this site on making ascii mathematica plots in the terminal –  rm -rf Mar 19 '13 at 4:53
    
@rm-rf Ideally I would like to be able to rerun commands, similar to the notebook interface(Shift+Enter). Also cursor support to move to different locations would be ideal. I'm editing the question to add additional info. –  Liam William Mar 19 '13 at 4:57
    
I think you just need a readline wrapper for that, which will allow you to use the arrow keys for movement. That was also asked and answered. mathematica.stackexchange.com/q/11192/5 –  rm -rf Mar 19 '13 at 5:05
    
I believe this, pages.uoregon.edu/noeckel/Mathematica.html might enable cursor support by using emacs to access mathematica through the command line –  Liam William Mar 19 '13 at 5:09
    
Yes indeed. You can launch emacs and do Esc-x shell. Then launch the Mathematica Kernel (usually with the command math). That's it. Now you can move up and down with the cursor and re-run commands. However, cursor clicking won't work unless you start an XWindow server (which costs you some of the speed advantages that a pure text terminal has). –  Jens Mar 19 '13 at 5:30

2 Answers 2

up vote 3 down vote accepted

I'll just show some screen shots of what it looks like when you run the Mathematica Kernel from within emacs in the Terminal on Mac OS X. This is the purely cursor-driven text terminal, no mouse support:

  • Start emacs
  • type EscxshellReturn
  • type math
  • start entering Mathematica commands, entering them with Shift-Return
  • Do some calculations and backtrack with the cursor:

t1

  • press Shift-Return

t2

  • backtrack with cursor:

t3

  • press Shift-Return

t4

Etc.

You can also save this session as a file.

share|improve this answer
    
Do you mind trying? M-X xterm mouse mode My emacs keeps throwing an error( mine isn't compiled for mouse support currently), but I quiet curious to see if that enables mouse support for you –  Liam William Mar 19 '13 at 5:55
    
I can't get that to work either (in Terminal). But mouse support works perfectly fine within Aquamacs emacs (an OS X native emacs port I have installed). Anyway, the thing is that remote Xwindow connections are always so slow that I don't bother with them. –  Jens Mar 19 '13 at 6:08
    
From Aquamacs emacs on my local machine, I can launch a remote connection and run math on the host. Then point and click works without having to start an XWindow session. –  Jens Mar 19 '13 at 6:12

On Unix you can install rlwrap

 (~/)> rlwrap math

 Mathematica 8.0 for Mac OS X x86 (64-bit)
 Copyright 1988-2011 Wolfram Research, Inc.

In[1]:= 1+1

Out[1]= 2

it saves the commands, and you can use up-arrows to access previously typed commands.

share|improve this answer
    
This is what I pointed the OP to in the comments... if this is all there is to the question, then it is a dupe of the linked one. –  rm -rf Mar 19 '13 at 18:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.