History

just read stdin for readcons() until i figured out tty raw processing

cinap_lenrek committed 10 years ago

Commit 94161e01 parent 65d683b1 file · +2 −19Browse files

Unified · Split

kern/devcons.c+2−19
@@ -11,16 +11,6 @@ · 10 unmodified lines
1111 #undef write
1212 #undef read
1313
14−#ifndef WINDOWS
15−/* get raw character from console without echo */
16−static int
17−_getch(void)
18−{
19− /* TODO */
20− return -1;
21−}
22−#endif
23−
2414 void (*consdebug)(void) = 0;
2515 void (*screenputs)(char*, int) = 0;
2616
@@ -582,15 +572,8 @@ consclose(Chan *c) · 555 unmodified lines
582572 static int
583573 readcons(Queue *q, char *buf, int n)
584574 {
585− while(screenputs==0 && !qcanread(q)){
586− int c;
587−
588− if((c = _getch()) == -1)
589− return read(0, buf, n);
590− if(c == '\r')
591− c = '\n';
592− kbdputc(q, c);
593− }
575+ if(screenputs==0 && !qcanread(q))
576+ return read(0, buf, n);
594577 return qread(q, buf, n);
595578 }
596579

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t