mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: use builtin cd in command wrapper to bypass shell aliases
Version managers like frum (Ruby), rvm, nvm, and others commonly alias cd to a wrapper function that runs additional logic after directory changes. When Hermes captures the shell environment into a session snapshot, these aliases are preserved. If the wrapper function fails in the subprocess context (e.g. frum not on PATH), every cd fails, causing all terminal commands to exit with code 126. Using builtin cd bypasses any aliases or functions, ensuring the directory change always uses the real bash builtin regardless of what version managers are installed.
This commit is contained in:
parent
3e95963bde
commit
435d86ce36
1 changed files with 1 additions and 1 deletions
|
|
@ -383,7 +383,7 @@ class BaseEnvironment(ABC):
|
|||
quoted_cwd = (
|
||||
shlex.quote(cwd) if cwd != "~" and not cwd.startswith("~/") else cwd
|
||||
)
|
||||
parts.append(f"cd {quoted_cwd} || exit 126")
|
||||
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