mono / mono.posix

POSIX/Unix interface for Mono, .NET and .NET Core. Provides functionality for managed code to access POSIX/Unix features not accessible via the BCL. This repository supersedes the older code in https://github.com/mono/mono
MIT License
42 stars 10 forks source link

Is tcgetattr supported? #35

Closed kjpgit closed 1 year ago

kjpgit commented 1 year ago

I don't see it on http://docs.go-mono.com/?link=N%3aMono.Unix or in grep

I wrote a console app using Tmds.Linux, and it works great on Linux/WSL, but is not portable to Mac currently.

And the .net built-in console support does not seem sufficient. I don't see how to force the tty back to 'echo' mode right before an execve.

akoeplinger commented 1 year ago

It is not supported right now, it'd need to be added in Syscall.cs and presumable some native wrappers for the termios struct.

https://github.com/mono/mono.posix/blob/062156d94302990cf742883bc688a1c9a1982a9f/src/Mono.Unix/Mono.Unix.Native/Syscall.cs#L5025

kjpgit commented 1 year ago

I'm hacking around this limitation as follows:

execve("sh -c 'stty sane; exec $my_target_prog $my_args'")