mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
fix(env): pass -- to cd for hyphen-prefixed workdirs
This commit is contained in:
parent
ae40fca955
commit
edf9c75621
2 changed files with 16 additions and 8 deletions
|
|
@ -405,7 +405,8 @@ class BaseEnvironment(ABC):
|
|||
# Preserve bare ``~`` expansion, but rewrite ``~/...`` through
|
||||
# ``$HOME`` so suffixes with spaces remain a single shell word.
|
||||
quoted_cwd = self._quote_cwd_for_cd(cwd)
|
||||
parts.append(f"builtin cd {quoted_cwd} || exit 126")
|
||||
# ``--`` keeps hyphen-prefixed directory names from being parsed as options.
|
||||
parts.append(f"builtin cd -- {quoted_cwd} || exit 126")
|
||||
|
||||
# Run the actual command
|
||||
parts.append(f"eval '{escaped}'")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue