xontrib-sh icon indicating copy to clipboard operation
xontrib-sh copied to clipboard

Support updating environment variables

Open anki-code opened this issue 3 years ago • 0 comments

The idea:

  1. Get prev_env = $(env) before running the sh-command
  2. Run sh-command. Example ! export QWE=123.
  3. Add saving env at the end of command: ! export QWE=123 ; env > /tmp/post_env.
  4. By comparing prev_env and post_env update the environment in the current session i.e. $QWE='123'

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

anki-code avatar Mar 23 '23 19:03 anki-code