Code Monkey home page Code Monkey logo

Comments (19)

sebma avatar sebma commented on August 24, 2024 1

Hi, I had to do this with brew :

$ brew link -v --force readline
Linking /usr/local/Cellar/readline/7.0.3_1...
ln -s ../Cellar/readline/7.0.3_1/include/readline readline
ln -s ../../Cellar/readline/7.0.3_1/share/doc/readline readline
ln -s ../../Cellar/readline/7.0.3_1/share/info/history.info history.info
info /usr/local/share/info/history.info
ln -s ../../Cellar/readline/7.0.3_1/share/info/readline.info readline.info
info /usr/local/share/info/readline.info
ln -s ../../Cellar/readline/7.0.3_1/share/info/rluserman.info rluserman.info
info /usr/local/share/info/rluserman.info
ln -s ../../../Cellar/readline/7.0.3_1/share/man/man3/history.3 history.3
ln -s ../../../Cellar/readline/7.0.3_1/share/man/man3/readline.3 readline.3
ln -s ../Cellar/readline/7.0.3_1/share/readline readline
ln -s ../Cellar/readline/7.0.3_1/lib/libhistory.7.0.dylib libhistory.7.0.dylib
ln -s ../Cellar/readline/7.0.3_1/lib/libhistory.7.dylib libhistory.7.dylib
ln -s ../Cellar/readline/7.0.3_1/lib/libhistory.a libhistory.a
ln -s ../Cellar/readline/7.0.3_1/lib/libhistory.dylib libhistory.dylib
ln -s ../Cellar/readline/7.0.3_1/lib/libreadline.7.0.dylib libreadline.7.0.dylib
ln -s ../Cellar/readline/7.0.3_1/lib/libreadline.7.dylib libreadline.7.dylib
ln -s ../Cellar/readline/7.0.3_1/lib/libreadline.a libreadline.a
ln -s ../Cellar/readline/7.0.3_1/lib/libreadline.dylib libreadline.dylib
16 symlinks created

And now the configuration and build worked :)

from rlwrap.

hanslub42 avatar hanslub42 commented on August 24, 2024

In most cases where rlwrap doesn't seem to do anything at all one needs to add the --always-readline (-a) option.

$ rlwrap -a -c -m " \ " -H "$MATLAB/history.m" matlab -nodesktop -nosplash

This should work, but then, if the rlwrapped program ever asks for single keypresses, like in: really burn your house? Y/N you will have to always follow this single keypress with ENTER, which quickly becomes annoying (though it might save your house)

Therfore, it is often better to get the rlwrapped program to not do any line editing, and to omit the -a option. With node, for example, one can do:

$ NODE_NO_READLINE=1 rlwrap node

I don't know whether matlab has a similar option or environment variable.

from rlwrap.

sebma avatar sebma commented on August 24, 2024

First, on MacOS, you have to give an argument for each option otherwise -a -c will be interpreted as -a=c

What option can I give to -a ?

Second, if rlwrap does not do the line editing, what else do I need it for ?

from rlwrap.

hanslub42 avatar hanslub42 commented on August 24, 2024

What option can I give to -a ?

Anything will do, but use something that is not likely to ever show up as a prompt

rlwrap -a xxxxx -c -m " \ " -H "$MATLAB/history.m" matlab -nodesktop -nosplash

Second, if rlwrap does not do the line editing, what else do I need it for ?

I wrote: "Therefore, it is often better to get the rlwrapped program to not do any line editing". The rlwrapped program is matlab, not rlwrap itself. So rlwrap is doing the line editing, while matlab shouldn't be doing any.

from rlwrap.

sebma avatar sebma commented on August 24, 2024

You're right, I misunderstood the second part, sorry.

On Linux, what is the default argument set by your rlwrap binary for the -a option ?
Maybe I can use the same argument on MacOS.

from rlwrap.

hanslub42 avatar hanslub42 commented on August 24, 2024

On Linux, what is the default argument set by your rlwrap binary for the -a option ?

There is none. (internally, rlwrap will use the NULL pointer to signal that -a didn't have an argument, but you cannot give that as an argument). I would use a nonsense string like dusynqwue7sid

from rlwrap.

sebma avatar sebma commented on August 24, 2024

How about an empty string, like this : -a "" ?

from rlwrap.

sebma avatar sebma commented on August 24, 2024

It does not seem to work with an empty string :(

Trying with a nonsense string ...

from rlwrap.

sebma avatar sebma commented on August 24, 2024

Everything works with : -a any, except Ctrl+D

Do you have any idea why Ctrl+D does not work ?

from rlwrap.

hanslub42 avatar hanslub42 commented on August 24, 2024

Do you have any idea why Ctrl+D does not work ?

No. It happens sometimes (usually on non-glibc systems) but I have never looked into it.

Can you run rlwrap with the --debug option? If not, can you compile it yourself?

If so, you could help me with

$ rlwrap --debug -a xxxxx -c -m " \ " -H "$MATLAB/history.m" matlab -nodesktop -nosplash

and then sending me the resulting /tmp/rlwrap.debug

from rlwrap.

sebma avatar sebma commented on August 24, 2024

I need to rebuild it

from rlwrap.

sebma avatar sebma commented on August 24, 2024

Having issues configuring :

configure: checking for pty ranges...
checking for tgetent... no
checking for tgetent in -ltinfo... no
checking for tgetent in -lcurses... yes
checking for readline in -lreadline... yes
checking for tigetnum... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking whether your readline headers and library know about rl_set_screen_size... yes
checking whether your readline headers and library know about rl_basic_quote_characters... no
configure: error:

********************************************************************************
The readline library that I found is incomplete, probably just a wrapper
around libedit (like on Mac OS X) Please install GNU Readline and re-configure
with the correct CFLAGS and LDFLAGS (cf. the instructions in INSTALL)
********************************************************************************
$  brew list | grep readline
readline

from rlwrap.

sebma avatar sebma commented on August 24, 2024

Here is my configure command, can you help ?

$ ./configure --prefix=/usr/local --exec-prefix=/usr/local CFLAGS=-I/usr/local/include CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib --enable-debug

from rlwrap.

hanslub42 avatar hanslub42 commented on August 24, 2024

Your configure command looks OK, provided you have the real (GNU) readline installed under /usr/local. In OS X, the default readline library is (for copyright reasons) only an incomplete emulation of GNU readline (actually a thin wrapper around editline)

If you manage to install GNU readline (maybe using brew) you should substitute its location for the /usr/local in your configure command, so that it can pick up the right readline library.

from rlwrap.

sebma avatar sebma commented on August 24, 2024

I already installed readline using brew :

$ brew list | grep readline
readline

Next Tuesday (this comming Monday is off), I'll check it's location to see if brew installed it in /usr/local

from rlwrap.

sebma avatar sebma commented on August 24, 2024

Here is the rlwrap.debug

from rlwrap.

sebma avatar sebma commented on August 24, 2024

BTW: Matlab completion does not work with rlwrap.
That is the most annoying, actually.

from rlwrap.

hanslub42 avatar hanslub42 commented on August 24, 2024

Thanks for the debug file. rlwrap indeed loses the original Matlab completion. There are ways to get this completion back, cf the StackOverflow question A node shell based on gnu readline

from rlwrap.

hanslub42 avatar hanslub42 commented on August 24, 2024

The only unsolved issue in this exchange is CTRL+D not working, which I cannot reproduce right now. Closing.

from rlwrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.