Comments (19)
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.
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.
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.
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.
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.
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.
How about an empty string, like this : -a ""
?
from rlwrap.
It does not seem to work with an empty string :(
Trying with a nonsense string ...
from rlwrap.
Everything works with : -a any
, except Ctrl+D
Do you have any idea why Ctrl+D
does not work ?
from rlwrap.
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.
I need to rebuild it
from rlwrap.
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.
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.
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.
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.
Here is the rlwrap.debug
from rlwrap.
BTW: Matlab completion does not work with rlwrap
.
That is the most annoying, actually.
from rlwrap.
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.
The only unsolved issue in this exchange is CTRL+D
not working, which I cannot reproduce right now. Closing.
from rlwrap.
Related Issues (20)
- Python filter can't be loaded HOT 4
- build failed: possibly undefined macro: AM_INIT_AUTOMAKE HOT 1
- brew install for rlwrap fails on a mac (m1 arm) HOT 1
- rlwrap rewrites the input line right-shifted HOT 12
- rlwrap segfaults on test program HOT 1
- Right-shifted input (or double prompt) after accepting a line in bracketed-paste-mode with readline-8.2 HOT 19
- The rlwrap program occasionally fails on several Solaris machines creating a fault alert HOT 4
- programs (like php -a) that put even a dumb terminal in bracketed-paste mode confuse rlwrap HOT 1
- rlwrap kills forked children HOT 2
- [feature] shell completion HOT 3
- Minor issue about english HOT 1
- rlwrap -a bc duplicates the line to the right HOT 1
- configure cannot find readline in non-root install HOT 6
- -f . should fail silently if there is no history (yet) HOT 2
- rlwrap modifies a line after entering HOT 1
- main_loop: Assertion `!always_readline' failed HOT 3
- Doesn't really work well with fish
- RlwrapFilter.pm-manpage broken in wiki
- [QUESTION] Make sure command output has a newline at the end
- Rlwrap doesn't work from inside Emacs' vterm or term
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rlwrap.