From cc280d7e5d07fd61e45825b3850c8baaa4147639 Mon Sep 17 00:00:00 2001 From: "Konstantin Kirik (snegovick)" Date: Tue, 9 Dec 2025 23:52:16 +0300 Subject: Add tab press detection --- sh9.b | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sh9.b b/sh9.b index 922a13c..64d88e1 100644 --- a/sh9.b +++ b/sh9.b @@ -145,7 +145,6 @@ init(ctxt: ref Context, argv: list of string) if(dfd == nil) return; - #stdin = sys->fildes(0); prompt := getusername() + "@" + sysname() + ":" + getcwd() + "; "; @@ -178,7 +177,10 @@ init(ctxt: ref Context, argv: list of string) ST_NORMAL => # check if escape if (temp == 27) { - state = ST_WAITCMD1; + state = ST_WAITCMD1; # is escape + } else if (temp == '\t') { + # tab complete rq + sys->print("tab"); } else if (temp == '\b') { if (seek == 0) { if (offset != 0) { @@ -211,7 +213,6 @@ init(ctxt: ref Context, argv: list of string) buf[offset] = byte(temp); offset ++; if ((offset >= len buf) || (buf[offset-1] == byte('\n'))) { - #sys->print("enter\n"); history_entry_cur = 0; seek = 0; sys->print("\n"); -- cgit v1.2.3