This won't work on Unixen unless you also change the terminal mode to cbreak, because otherwise the terminal doesn't even send the keypress until the end of line.
But once you start enabling cbreak, then you have to worry about disabling it, and you start to reinvent ncurses...
Comment #3 by lovelydear — 2012-04-19T07:47:17Z
This hasn't been discussed in the m-l.
bearophile, are you ok to close ?
Comment #4 by hsteoh — 2012-04-19T08:10:14Z
We shouldn't close issues unless it's either fixed or is a non-bug. If you think this issue deserves discussion, please start one on the forums.
Comment #5 by lovelydear — 2012-04-19T08:31:14Z
Yeah, but this request should have been discussed in the first place by bearophile. Just opening enhancement requests because one thinks this or that should be this way doesn't make any sense. If everybody starts to do that, it will turn to chaos pretty quickly.
I'm not the one who opened this enhancement request. I think the author should either ask on the forum, or close it. And if there has been a discussion, a link to it should be given here.
Comment #6 by lovelydear — 2012-04-19T08:36:40Z
An example of what I'm talking about is 7939.
The guy gives his opinion, without even a debate in the mailing-list. Where does that come from ?
Comment #7 by lovelydear — 2012-04-19T08:37:37Z
(In reply to comment #6)
> An example of what I'm talking about is 7939.
> The guy gives his opinion, without even a debate in the mailing-list. Where
> does that come from ?
OUps, I meant 7937
Comment #8 by bearophile_hugs — 2012-04-19T15:38:00Z
(In reply to comment #3)
> This hasn't been discussed in the m-l.
I have given a generic answer in Issue 7937
(In reply to comment #5)
> Yeah, but this request should have been discussed in the first place by
> bearophile. Just opening enhancement requests because one thinks this or that
> should be this way doesn't make any sense. If everybody starts to do that, it
> will turn to chaos pretty quickly.
I think for normal bug reports, or for very small enhancement requests (that require only a small and limited amount of code added or changed with no significant interactions with unrelated user code) discussing it only in Bugzilla is acceptable.
And I've seen that most people in newsgroups are not interested in very small things.
> bearophile, are you ok to close ?
I think that generally it's OK to close an enhancement request when it's not implementable, when it's a bad idea, when there are better ideas, when no one seems to desire the idea for a lot of time, when it asks for too much work for too little gain, etc.
In this specific case kennytm and hsteoh have given answers. There is a Windows-specific way to solve this, and on Unixes it's not immediate to do.
I am not qualified enough to tell if this enhancement request needs to be closed as WONTFIX.
Comment #9 by hsteoh — 2012-04-19T17:09:26Z
My feeling is that this bug is merely a small part of something much bigger: we need a console-interaction library in Phobos (along the lines of conio.h for windows or ncurses.h for *nixes). I'd prefer to leave this bug open until we either decide that a console interaction library doesn't belong in Phobos, or said library is merged and we can say "use this function from std.console to read a key".