pub async fn cd(ctx: CommandContext) -> CommandResultExpand description
Execute the cd command
Mirrors POSIX sh/bash semantics so that shell scripts translate directly:
cd-> change to $HOME (or $USERPROFILE on Windows)cd ~/cd ~/x-> tilde expands to $HOMEcd --> change to $OLDPWD and print the new directory (like sh)cd <dir>-> change to(relative paths resolve against the current working directory, or the cwdoption)
Like a real shell, a successful cd updates the PWD and OLDPWD
environment variables and changes the process directory so that subsequent
commands (virtual or real) observe the new location.