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
11#undef write11#undef write
12#undef read12#undef read
13 13
14#ifndef WINDOWS
15/* get raw character from console without echo */
16static int
17_getch(void)
18{
19 /* TODO */
20 return -1;
21}
22#endif
23
24void (*consdebug)(void) = 0;14void (*consdebug)(void) = 0;
25void (*screenputs)(char*, int) = 0;15void (*screenputs)(char*, int) = 0;
26 16
@@ -582,15 +572,8 @@ consclose(Chan *c) · 555 unmodified lines
582static int572static int
583readcons(Queue *q, char *buf, int n)573readcons(Queue *q, char *buf, int n)
584{574{
585 while(screenputs==0 && !qcanread(q)){575 if(screenputs==0 && !qcanread(q))
586 int c;576 return read(0, buf, n);
587
588 if((c = _getch()) == -1)
589 return read(0, buf, n);
590 if(c == '\r')
591 c = '\n';
592 kbdputc(q, c);
593 }
594 return qread(q, buf, n);577 return qread(q, buf, n);
595}578}
596 579

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