feat(terminal): Add temp bindings to support musl

Druntime is missing the tcgetattr/tcsetattr binding for musl.
Here we add them to allow building on musl.
This commit is contained in:
Sebastiaan Koppe 2025-05-28 17:20:51 +02:00
parent 71d4934605
commit 1b5b7ffce0
1 changed files with 10 additions and 0 deletions

View File

@ -388,6 +388,16 @@ version(Posix) {
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) {