GithubHelp home page GithubHelp logo

racket-ansi's People

Contributors

jeapostrophe avatar liberalartist avatar samth avatar takikawa avatar tonyg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

racket-ansi's Issues

ld: warning: directory not found for option '-L./lib'

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.

Should `tty_raw.c` be replaced by `#%terminal`?

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:

void tty_set_restore_at_exit(void) {
atexit((void (*)(void)) tty_restore);
}

โ€ฆ 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.

raw-tty-extension improvements

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

  1. How do I use /bin/stty instead of tty-raw!? What settings are really needed?
  2. How can we figure out what the right /dev/ttys is or alternatively, what is making /dev/tty on my set up slower... is it an stty setting?

Support Racket on Chez Scheme

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).

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.