lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Title: RE: newbie question about readline

To clarify, my lcc-win32 compiled lua5 when run from the command shell (cmd.exe) just automagically has command line history available (and by this I mean that I didn't add anything to the lua source code). I think this works because whatever standard input mechanism exists in WinXP gets inherited by apps run from cmd.exe.

Try it out on your box. Just go Start->Run... Type cmd.exe in the dialog box that appears. From this shell, run your lua interpreter. Type some commands (like s=1+1) and press enter. Then see if you can use the up and down arrow keys to see other commands. Then enter io.read() and press enter. If your WinXP/cmd.exe/lua works like mine, you can still arrow up/down to see other things you've entered while using lua.

For similar capabilities under Linux, you can use the rl_wrap program I mentioned earlier to run lua and have similar capabilities... All without adding ANYTHING to lua.

If you want to try my compiled version of lua, I'd be happy to email it to you outside this list.

-j

-----Original Message-----
From: analisifunzionale [mailto:analisifunzionale@interfree.it]
Sent: Friday, February 13, 2004 4:47 PM
To: Lua list
Subject: Re: newbie question about readline


Stewart, Joseph wrote:

 > What compiler are you using under windows, and what version of
Windows are you using?


I'm using Win XP and VisualC++ .net (7.0).

 > If you're using >=Win2k and start lua from cmd.exe you should get
line editing/command history more or less for "free"; <=WinME you
probably have to roll your own.


This is an interesting news... can you take me more detail, please?
There is ad autmatic readline-like support in io:read() if I use cmd.exe?

 > Do you have a readline library for your compiler?

In VC++ there is a library that do it.
Why I want user GNU readline? My problem is that I would like make a
multiplatform code if is possible. If the support readline was enbeded
in Lua, it was immediate. Otherwise, I must write more code or... or
develop in gcc and compile by cygwin :)


matteo!



- - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - -
This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.