Fix Linenoise REPL on AARCH64

This commit is contained in:
Justine Tunney 2023-06-04 02:57:17 -07:00
parent bcf9af94bf
commit fc34ba2596
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 9 additions and 6 deletions

View file

@ -126,6 +126,7 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "third_party/linenoise/linenoise.h"
#include "libc/assert.h" #include "libc/assert.h"
#include "libc/calls/calls.h" #include "libc/calls/calls.h"
#include "libc/calls/sig.internal.h" #include "libc/calls/sig.internal.h"
@ -169,7 +170,6 @@
#include "libc/sysv/consts/termios.h" #include "libc/sysv/consts/termios.h"
#include "libc/sysv/errfuns.h" #include "libc/sysv/errfuns.h"
#include "net/http/escape.h" #include "net/http/escape.h"
#include "third_party/linenoise/linenoise.h"
#include "tool/build/lib/case.h" #include "tool/build/lib/case.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\
@ -290,11 +290,11 @@ static const char *const kUnsupported[] = {"dumb", "cons25", "emacs"};
static int gotint; static int gotint;
static int gotcont; static int gotcont;
static int gotwinch; static int gotwinch;
static char rawmode = -1;
static char maskmode; static char maskmode;
static char ispaused; static char ispaused;
static char iscapital; static char iscapital;
static int historylen; static int historylen;
static signed char rawmode = -1;
static struct linenoiseRing ring; static struct linenoiseRing ring;
static struct sigaction orig_int; static struct sigaction orig_int;
static struct sigaction orig_quit; static struct sigaction orig_quit;
@ -2175,11 +2175,11 @@ ssize_t linenoiseEdit(struct linenoiseState *l, const char *prompt, char **obuf,
default: default:
break; break;
} }
} else if (rc == 6 && seq[2] == '1' && } else if (rc == 6 && seq[2] == '1' && seq[3] == ';' &&
seq[3] == ';' && seq[4] == '5') { seq[4] == '5') {
switch (seq[5]) { switch (seq[5]) {
CASE('C', linenoiseEditRightWord(l)); // \e[1;5C ctrl-right CASE('C', linenoiseEditRightWord(l)); // \e[1;5C ctrl-right
CASE('D', linenoiseEditLeftWord(l)); // \e[1;5D ctrl-left CASE('D', linenoiseEditLeftWord(l)); // \e[1;5D ctrl-left
default: default:
break; break;
} }

View file

@ -7490,6 +7490,9 @@ void RedBean(int argc, char *argv[]) {
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
#if !IsTiny() && !defined(__x86_64__)
ShowCrashReports();
#endif
LoadZipArgs(&argc, &argv); LoadZipArgs(&argc, &argv);
RedBean(argc, argv); RedBean(argc, argv);