Skip to content

Commit

Permalink
Remove partial autofill in terminal.
Browse files Browse the repository at this point in the history
Not removed the possible commands listing.
  • Loading branch information
bill88t committed Jan 21, 2024
1 parent 710485c commit 321c5bc
Showing 1 changed file with 3 additions and 33 deletions.
36 changes: 3 additions & 33 deletions source/ljinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,42 +1809,12 @@ def shell(led: bool = True, nalias: bool = False) -> int:
candidates.append(j)
if len(candidates) > 1:
term.write()
minn = 100
for i in candidates:
if not i.startswith("_"): # discard those
minn = min(minn, len(i))
term.nwrite("\t" + i)
letters_match = 0
isMatch = True
while isMatch:
for i in range(0, minn):
for j in range(1, len(candidates)):
try:
if (
not candidates[j][letters_match]
== candidates[j - 1][
letters_match
]
):
isMatch = False
break
else:
letters_match += 1
except IndexError:
isMatch = False
break
if not isMatch:
break
if letters_match > 0:
term.clear_line()
if lent > 1:
term.buf[1] = " ".join(
slicedd[:-1]
+ [candidates[0][:letters_match]]
)
else:
term.buf[1] = candidates[0][:letters_match]
term.nwrite(" " + i)
del i
term.focus = 0
term.write()
elif len(candidates) == 1:
term.clear_line()
if lent > 1:
Expand Down

0 comments on commit 321c5bc

Please sign in to comment.