Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module test;
- import std.stdio;
- import core.sys.posix.termios;
- import core.sys.posix.unistd;
- alias core.stdc.stdio.fileno fileno;
- alias core.stdc.stdio.stdin stdin;
- termios savedterm;
- void initterm ()
- {
- termios outterm;
- setbuf(stdin, null);
- tcgetattr(fileno(stdin), &savedterm);
- outterm=savedterm;
- outterm.c_lflag &= ~(ECHO | ICANON);
- outterm.c_iflag &= ~ICRNL;
- outterm.c_cc[VMIN]=1;
- outterm.c_cc[VTIME]=0;
- tcsetattr(fileno(stdin), TCSANOW, &outterm);
- }
- void main ()
- {
- char c;
- initterm();
- read(fileno(stdin), &c, 1);
- writeln("***********");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement