nazriel wrote: > http://dpaste.dzfl.pl/eb1387cc Thank you. Your solution does not seem to work with multibyte characters, so I extended it:
import core.sys.posix.termios; import core.stdc.stdio; char getch() { int ch; termios oldt; termios newt; tcgetattr(0, &oldt); newt = oldt; newt.c_lflag &= ~(ICANON | ECHO); tcsetattr(0, TCSANOW, &newt); ch = getchar(); tcsetattr(0, TCSANOW, &oldt); return cast(char) ch; } import std.utf; char readChar() { char[4] buffer; buffer[0] = getch(); auto len = stride(buffer,0); foreach (i ; 1 .. len) buffer[i] = getch(); size_t i; return cast(char) decode(buffer, i); }