You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both cwd and env have T in RefCell<T> that can be cloned, so a "deep clone" (not a RefCell clone) could be implemented for Shell. It would be useful to do this in order to create "related" shells (e.g. nix style development shells) from a current shell.
cwd can already be reported via current_dir, and PR #78 aims to expose similar functionality for env. Therefore, it would be possible to create a new shell (Shell::new()) that is a clone of an existing shell by setting its current working directory and environment variables appropriately using set_var (based on the output of the proposed vars_os method on the original shell).
So, implementing Clone would provide this functionality in an idiomatic form?
The text was updated successfully, but these errors were encountered:
There are two fundamental parts to an
xshell::Shell
: https://docs.rs/xshell/latest/src/xshell/lib.rs.html#383Both
cwd
andenv
haveT
inRefCell<T>
that can be cloned, so a "deep clone" (not aRefCell
clone) could be implemented forShell
. It would be useful to do this in order to create "related" shells (e.g. nix style development shells) from a current shell.cwd
can already be reported viacurrent_dir
, and PR #78 aims to expose similar functionality forenv
. Therefore, it would be possible to create a new shell (Shell::new()
) that is a clone of an existing shell by setting its current working directory and environment variables appropriately usingset_var
(based on the output of the proposedvars_os
method on the original shell).So, implementing
Clone
would provide this functionality in an idiomatic form?The text was updated successfully, but these errors were encountered: