tonyg / racket-ansi Goto Github PK
View Code? Open in Web Editor NEWANSI and VT10x escape sequences for Racket.
License: Other
ANSI and VT10x escape sequences for Racket.
License: Other
When installing racket-ansi on macOS, I get the warning shown in the title. Here is the raco setup output:
raco setup: pre-installing: <pkgs>/ansi/ansi (ansi)
make: making /Users/travishinkelman/Library/Racket/7.2/pkgs/ansi/ansi/private/compiled/native/x86_64-macosx/3m/tty-raw-extension.c because /Users/travishinkelman/Library/Racket/7.2/pkgs/ansi/ansi/private/compiled/native/x86_64-macosx/3m/tty-raw-extension.c does not exist
xform-cpp: (/usr/bin/gcc -E -DOS_X -DMZ_PRECISE_GC -I./include -I/Users/travishinkelman/Library/Racket/7.2/pkgs/ansi/ansi/private/ -I/Applications/Racket v7.2/include -I/Applications/Racket v7.2/include -DMZ_XFORM -DMZ_PRECISE_GC -DGC_STACK_CALLEE_RESTORE tty-raw-extension.c)
make: making compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.o because compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -fno-common -DOS_X -DMZ_PRECISE_GC -I./include -I/Applications/Racket v7.2/include /Users/travishinkelman/Library/Racket/7.2/pkgs/ansi/ansi/private/compiled/native/x86_64-macosx/3m/tty-raw-extension.c -o compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.o)
make: making compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.dylib because compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.dylib does not exist
link-extension: (/usr/bin/gcc -bundle -flat_namespace -undefined suppress -L./lib compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.o /Applications/Racket v7.2/lib/mzdyn3m.o -o compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.dylib)
ld: warning: directory not found for option '-L./lib'
make: made /Users/travishinkelman/Library/Racket/7.2/pkgs/ansi/ansi/private/compiled/native/x86_64-macosx/3m/tty-raw-extension.c
make: made compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.o
make: made compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.dylib
When ansi is loaded in DrRacket, I get this message:
default-load-extension-handler: forbidden (execute) access to /Users/travishinkelman/Library/Racket/7.2/pkgs/ansi/ansi/private/compiled/native/x86_64-macosx/3m/tty-raw-extension_ss.dylib
These warnings don't seem to present a problem to running the little bit of my code that depends on the raart module. And I realize that it might not be specific to the ansi package. I'm new to Racket and not sure how to troubleshoot this particular problem so starting here.
Thanks.
In v8.4, Racket gained a new primitive module #%terminal
to support the Expeditor: Terminal Expression Editor. Using its function terminal-raw-mode
, I think we could eliminate our tty_raw.c
by replacing tty_raw()
and tty_restore()
with (terminal-raw-mode #t)
and (terminal-raw-mode #f)
, respectively.
The only functionality I'm not sure how to directly replicate is:
racket-ansi/ansi/private/tty_raw.c
Lines 46 to 48 in c14081d
โฆ but maybe there's a more cooperative way to clean up with #%terminal
?
The obvious downside is that #%terminal
is an undocumented internal module, but maybe (@mflatt?) using (only-in '$%terminal terminal-raw-mode)
is likely to be stable in practice.
I want to write programs like less
where I can do ls -l | less
and get the input, as well as interact as a terminal.
tty-raw!
assumes that you always want to use STDIN
, so that's a problem. It is easy to use scheme_get_port_file_descriptor
to get a different descriptor, but then the logic of saved
and is_raw
is really broken.
In charterm
, the standard is to open /dev/tty
as a I/O file and /bin/stty raw -echo
to enable raw access. However, in my set up (OS X & tmux) this is drastically slower than using STDIN
. I also find that if I instead use /dev/ttys003
(or whatever it happens to be---by running tty
in the shell before starting) then it is as fast as it should be.
Additionally, it seems that /bin/stty raw -echo
is not exactly the same the raw settings that tty-raw!
uses. (I think the main difference is that you want pass8
, but I'm not sure.)
So, I have two problems that you might have the solution to
/bin/stty
instead of tty-raw!
? What settings are really needed?/dev/ttys
is or alternatively, what is making /dev/tty
on my set up slower... is it an stty
setting?The same issue as tonyg/racket-unix-signals#1 (which is a prerequisite).
Racket on Chez Scheme doesn't support extension modules implemented in C, so a change is needed to tty-raw-extension.c
. The ideal solution would be to use the FFI exclusively, but building a C shared library would still work as long as it doesn't #include "escheme.h"
(which is specific to the traditional Racket VM).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.