codegpt-ai 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chat.py +13 -1
- package/package.json +1 -1
package/chat.py
CHANGED
|
@@ -471,9 +471,15 @@ class SlashCompleter(Completer):
|
|
|
471
471
|
text = document.text_before_cursor.lstrip()
|
|
472
472
|
if text.startswith("/"):
|
|
473
473
|
typed = text.lower()
|
|
474
|
-
|
|
474
|
+
on_termux = os.path.exists("/data/data/com.termux")
|
|
475
|
+
|
|
476
|
+
# Main commands — hide unsupported tool commands on Termux
|
|
475
477
|
for cmd, desc in COMMANDS.items():
|
|
476
478
|
if cmd.startswith(typed):
|
|
479
|
+
# Skip tool commands that don't work on Termux
|
|
480
|
+
tool_name = cmd[1:]
|
|
481
|
+
if on_termux and tool_name in AI_TOOLS and not AI_TOOLS[tool_name].get("termux", True):
|
|
482
|
+
continue
|
|
477
483
|
yield Completion(
|
|
478
484
|
cmd,
|
|
479
485
|
start_position=-len(text),
|
|
@@ -5736,6 +5742,12 @@ def main():
|
|
|
5736
5742
|
tool_key = cmd[1:] # strip /
|
|
5737
5743
|
tool = AI_TOOLS[tool_key]
|
|
5738
5744
|
tool_bin = tool["bin"]
|
|
5745
|
+
|
|
5746
|
+
# Block unsupported tools on Termux
|
|
5747
|
+
is_termux = os.path.exists("/data/data/com.termux")
|
|
5748
|
+
if is_termux and not tool.get("termux", True):
|
|
5749
|
+
print_err(f"{tool['name']} doesn't work on Termux.")
|
|
5750
|
+
continue
|
|
5739
5751
|
tool_args = user_input[len(cmd):].strip()
|
|
5740
5752
|
|
|
5741
5753
|
if shutil.which(tool_bin):
|