Improve linenoise and get it working on Windows

Some progress has been made on introducing completion but there's been
difficulties using the Python C API to get local shell variables.
This commit is contained in:
Justine Tunney 2021-08-15 00:05:27 -07:00
parent 968474d291
commit 5029e20bef
23 changed files with 408 additions and 209 deletions

View file

@ -41,7 +41,8 @@ textwindows int ioctl_tcgets_nt(int ignored, struct termios *tio) {
if (inmode & kNtEnableProcessedInput) tio->c_lflag |= IEXTEN | ISIG;
}
if (outok) {
if (inmode & kNtEnableProcessedInput) tio->c_lflag |= IEXTEN | ISIG;
if (outmode & kNtEnableProcessedOutput) tio->c_oflag |= OPOST;
if (!(outmode & kNtDisableNewlineAutoReturn)) tio->c_oflag |= ONLCR;
}
return 0;
} else {

View file

@ -51,8 +51,8 @@ textwindows int ioctl_tcsets_nt(int ignored, uint64_t request,
}
if (outok) {
outmode |= kNtEnableWrapAtEolOutput;
outmode |= kNtEnableProcessedOutput;
if (!(tio->c_oflag & OPOST)) outmode |= kNtDisableNewlineAutoReturn;
if (tio->c_oflag & OPOST) outmode |= kNtEnableProcessedOutput;
if (!(tio->c_oflag & ONLCR)) outmode |= kNtDisableNewlineAutoReturn;
if (NtGetVersion() >= kNtVersionWindows10) {
outmode |= kNtEnableVirtualTerminalProcessing;
}

View file

@ -102,6 +102,7 @@ ssize_t readansi(int fd, char *buf, size_t size) {
break;
case kCsi:
switch (c) {
case '[':
case ':':
case ';':
case '<':