Closed matklad closed 2 years ago
Thanks for the review @azdavis!
Whats your overall feeling on the direction this is going in?
(I'm just passing by, but I wanted to say: it's a damn good job guys! Keep going !)
I like less global state, and renaming the fs functions to be more searchable is good too!
bors r+
This is a significant rewrite of xshell. The main change is the switch from global-state API to object based API --
Shell
is now a thing and is the gateway to all API.Motivation is manyfold:
fs
API is unergonomic, as it requires importing many individual functions. With the new style API,use xshell::{Shell, cmd};
is all you need, and API is discoverable viash.
auto-completion.gsl
.Specific changes:
Shell
which holds the environment. For ergonomics reasons,Shell
uses interior mutability.cmd!
macro now requires aShell
as a first argument.Cmd
builder methods are somewhat more orthogonal.With the present API, I also feel we should shift from "convenient hacks" to "robust tool". As a first step to that end, stdin is now fed via a dedicated thread, to aviod deadlock.
This is mostly done I think, but I at least need to check this on windows as well.