I'm new to this list so I'm sorry if this has been answered recently (I
did a search through the archive and it didn't come up with anything).
Anyway, I'm having a problem with the command history in Jython. When I
hit the up arrow, instead of getting my previous commands, I get ^[OA.
Command history works correctly in CPython 2.0. Is this feature
supported in Jython?
I'm running on JDK 1.3 (Blackdown 1.3.0 FCS).
This was answered recently on the (gradually more defunct) JPython list,
more info will be in that archive:
> -----Original Message-----
> From: Robert W. Bill [SMTP:rbill@...]
> Sent: Sunday, January 07, 2001 12:47 AM
> To: Steve Cohen
> Cc: jpython-interest@...
> Subject: Re: [JPython] jpython interpreter under linux
> On Sat, 6 Jan 2001, Steve Cohen wrote:
> > I am trying to run jpython interactively from a pc at home. I am used
> > to running it at work under NT 2000, where it works quite nicely. At
> > home, though, I have a PC on which I can run either Windows 98 or Red
> > Hat LInux 6.2. Forget Win98, it doesn't have a console worth messing
> > with, total crap.
> > Under Linux, there are several console programs. The default one,
> > kvt, konsole, the Gnome shell and more. All have the same problem
> > with jpython. Something is causing the interactive jpython program
> > not to recognize the up and down arrow keys as requests for the
> > previous/next command in the history. This does not happen when the
> > shells are just at system command line mode (shell is bash), nor does
> > it happen under CPython. In both of these cases the arrow keys work
> > as expected. But when JPython is running, pressing them gets output
> > like [[A or something similar.
> > Is there a fix to this? Or how about a workaround, another way to
> > access the history functions?
> Hello Steve,
> What enables the up-down arrow history keys is the readline module. This
> is compiled into your CPython, and all the shells you mention. Readline
> is not available for JPython so the arrow keys do not work. It's not a
> matter of JPython looking to the shell for this, because it cannot, as
> CPython cannot, but rather a matter of looking at the compiled-in readline
> which CPython can, but Jython cannot.
> Although what your thinking of is sensible- a shell the wraps the running
> process. I know Yorick has one, and there may be others, but emacs is a
> great solution for Linux. If you start emacs and windows, go into shell
> mode, start Jython- *then* you have up-down arrow readline history with
> the Jython intereactive console (and cool editor).
> JPython-Interest maillist - JPython-Interest@...