oh-my-fish / plugin-foreign-env

Run foreign bash scripts and capture exported environment variables
MIT License
221 stars 15 forks source link

Add support for interactive commands #12

Closed mnewt closed 5 years ago

mnewt commented 7 years ago

Features required:

All I did was run the program normally, outside of a subshell. Then it can just do its thing as it would without fenv. Then the only trick is how to pick up the changes to env?

The only way I can think of is to dump env to a file from bash -c, then read the file back in from fenv. This is working for me in my tests. If you want me to include a test I'll add it--I didn't see any so I didn't want to pollute the pull request.

I briefly thought about using a fifo to avoid a possible disk read/write but then bash -c and fenv have to run in parallel so that seems too fancy for this situation.

I'm very open to suggestions/criticism/berating.