MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Text-based interface: Editing line input

  • To: mathgroup at
  • Subject: [mg91901] Re: Text-based interface: Editing line input
  • From: Ken Johnson <othojunk at>
  • Date: Fri, 12 Sep 2008 05:27:44 -0400 (EDT)
  • Reply-to: othojunk at

I didn't mean to make this a flame war, just ask for suggestions on solving
 a specific scenario that I encounter. That is why I tried the technical mailing list, rather than resorting to some random forum. While I definitely 
agree that the GUI version is much better, there are real reasons to use the text based interface (TBI). For instance originally my school only offered Mathematica on campus computers only. Rather than go to campus, I could log into a school Unix server. It is much easier to run the TBI for many basic things rather than using a vnc session to get the GUI up. Then at one point I could get my hands on Mathematica 5.2 for Linux, but the fonts wouldn
't show up on the GUI, and therefore the normal front end was unusable. Rather than properly fixing the problem, I just resort to the TBI (I know that I am lazy, but I didn't care to troubleshoot when I have a viable solution for my needs).

It is interesting that math.exe does provide in-line text editing. Well the linux versions do not. I guess I should have mentioned that I was using linux. However I did find a good solution to my problem on a linux forum. I can wrap the math command with rlwrap, which will intercept input from the command line and allow editing, history etc before passing it onto Mathematica.

rlwrap math

--- On Thu, 9/11/08, Szabolcs Horv=E1t <szhorvat at> wrote:

> From: Szabolcs Horv=E1t <szhorvat at>
> Subject: Re: Text-based interface: Editing line input
> To: othojunk at
> Date: Thursday, September 11, 2008, 4:52 AM
> Ken Johnson wrote:
>  > I have been enjoying mathematica, for a bit. While
> some might consider
>  > me a minimalist, I enjoy the text-based interface
> over the notebook
>  > style usage. However I severely miss the ability to
> move the cursor
>  > left and right for editing a single line. The
> documentation itself
>  > suggests pasting lines, but most of my pasting
> requires a little
>  > editing too. So instead of pasting whole lines of
> input, I resort to
>  > partial line paste, adding different text, then
> pasting the remaining
>  > relevant portion of a line.
>  >
> I would not call it being minimalistic ... it is more like
> senseless
> self torture ... But it seems that doing everything from a
> command line
> has become the new fad these days.
> Yes, you can use Mathematica from a very primitive command
> line, lose a
> lot of the functionality, but gain nothing  ...  Or you can
> use it with
> a very advanced command line where you *can* (but are not
> *forced to*)
> go back and edit any of the previous inputs (not just the
> current line),
> use automatic expression formatting and colouring, see
> graphics as the
> output of some functions, or even use graphics as input!
> This advanced
> command line interface to Mathematica is called the Front
> End.
>  > Is there any way to be able to freely move the cursor
> on a line? I
>  > have obviously tried the arrow keys, and also have
> tried emacs style
>  > movements as well with no luck (ctrl-b ctrl-f for
> backwards and
>  > forewards). Any suggestions?
>  >
> Your question is OS specific and you didn't say which
> OS you use.  On
> Windows try starting math.exe, which is a real console mode
> program (not
> MathKernel.exe).  All the usual input features of cmd.exe
> such as line
> editing and command history will be present.

  • Prev by Date: Re: Simulate a finite-state markov process
  • Next by Date: Re: Re: How to simplify ArcCos[x/Sqrt[x^2+y^2]] to Pi/2-ArcTan[x/Abs[y]]?
  • Previous by thread: Re: Text-based interface: Editing line input
  • Next by thread: Re: Text-based interface: Editing line input