mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 19:58:30 +00:00
Implement basic canonical mode for Windows
The `cat` command now works properly, when run by itself on the bash command prompt. It's working beautifully so far, and is only missing a few keystrokes for clearing words and lines. Definitely works more well than the one that ships with WIN32 :-)
This commit is contained in:
parent
4825737509
commit
f26a280cda
36 changed files with 320 additions and 231 deletions
12
third_party/linenoise/linenoise.c
vendored
12
third_party/linenoise/linenoise.c
vendored
|
@ -2485,13 +2485,13 @@ char *linenoise(const char *prompt) {
|
|||
if (linenoiseFallback(prompt, &res)) return res;
|
||||
fflush(stdout);
|
||||
fflush(stdout);
|
||||
rm = __replmode;
|
||||
rs = __replstderr;
|
||||
__replmode = true;
|
||||
if (isatty(2)) __replstderr = true;
|
||||
rm = __ttyconf.replmode;
|
||||
rs = __ttyconf.replstderr;
|
||||
__ttyconf.replmode = true;
|
||||
if (isatty(2)) __ttyconf.replstderr = true;
|
||||
res = linenoiseRaw(prompt, fileno(stdin), fileno(stdout));
|
||||
__replstderr = rs;
|
||||
__replmode = rm;
|
||||
__ttyconf.replstderr = rs;
|
||||
__ttyconf.replmode = rm;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue