racket-ansi icon indicating copy to clipboard operation
racket-ansi copied to clipboard

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

Open LiberalArtist opened this issue 1 year ago • 1 comments

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: https://github.com/tonyg/racket-ansi/blob/c14081de59bc7273f1f9088a51d6d9c202b2b9d0/ansi/private/tty_raw.c#L46-L48

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

LiberalArtist avatar Jan 23 '23 17:01 LiberalArtist