diff --git a/bot.py b/bot.py index a34d18e..eaad6d5 100644 --- a/bot.py +++ b/bot.py @@ -654,8 +654,10 @@ async def execute_cli_command_from_message(update: Update, command: str): working_dir = state.working_directory or config.get("working_directory", str(Path.home())) # Обработка команды cd - меняем директорию пользователя - if command.strip().startswith("cd "): - parts = command.strip().split(maxsplit=1) + # Работает только с простыми командами cd, не с составными + cmd_stripped = command.strip() + if cmd_stripped.startswith("cd ") and "&&" not in cmd_stripped and ";" not in cmd_stripped and "|" not in cmd_stripped: + parts = cmd_stripped.split(maxsplit=1) if len(parts) == 2: target_dir = parts[1]