Merge pull request #505 from skoppe/tcsetattr_musl

feat(terminal): Add bindings to support musl
This commit is contained in:
Adam D. Ruppe 2025-05-28 11:24:27 -04:00 committed by GitHub
commit 8f3d584698
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -388,6 +388,16 @@ version(Posix) {
import core.sys.posix.sys.ioctl; import core.sys.posix.sys.ioctl;
} }
version(CRuntime_Musl) {
// Druntime currently doesn't have bindings for termios on Musl.
// We define our own bindings whenever the import fails.
// When druntime catches up, this block can slowly be removed,
// although for backward compatibility we might want to keep it.
static if (!__traits(compiles, import core.sys.posix.termios : tcgetattr)) {
int tcgetattr (int, struct termios *);
int tcsetattr (int, int, const struct termios *);
}
}
version(VtEscapeCodes) { version(VtEscapeCodes) {