summaryrefslogtreecommitdiff
path: root/sh9.b
diff options
context:
space:
mode:
authorKonstantin Kirik (snegovick) <snegovick@uprojects.org>2025-12-09 23:52:16 +0300
committerKonstantin Kirik (snegovick) <snegovick@uprojects.org>2025-12-09 23:52:16 +0300
commitcc280d7e5d07fd61e45825b3850c8baaa4147639 (patch)
treef459d061e49dee67a7f1bec133d3028a3da9c0a4 /sh9.b
parente74b45936e5daaa12e4efd0593cab58c62056909 (diff)
Add tab press detection
Diffstat (limited to 'sh9.b')
-rw-r--r--sh9.b7
1 files 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");