fix(ssh): preserve remote tilde cwd

This commit is contained in:
helix4u 2026-07-03 14:28:45 -06:00 committed by kshitij
parent af0ce1cf8e
commit 83fb8ec277
4 changed files with 93 additions and 12 deletions

View file

@ -1286,7 +1286,7 @@ def _get_env_config() -> Dict[str, Any]:
# /workspace and track the original host path separately. Otherwise keep the
# normal sandbox behavior and discard host paths.
cwd = os.getenv("TERMINAL_CWD", default_cwd)
if cwd:
if cwd and not (env_type == "ssh" and (cwd == "~" or cwd.startswith("~/"))):
cwd = os.path.expanduser(cwd)
host_cwd = None
if env_type == "docker" and mount_docker_cwd: