abra-code / OMC

OnMyCommand
http://www.abracode.com/free/cmworkshop/on_my_command.html
MIT License
33 stars 5 forks source link

Add support for OMC_XXX environment variables when sending commands to Terminal or iTerm #8

Closed abra-code closed 5 years ago

abra-code commented 5 years ago

It is desired to have a uniform way of exporting OMC_XXX environment variables regardless of execution type. One deficiency is that you cannot send an Apple Event to Terminal or iTerm to set environment variables. Setting them explicitly as multi-line intro in Terminal would be too ugly. The idea is to create file in /tmp with OMC environment setup and source it as a the first command in Terminal. Not beautiful but should be acceptable. Such file can self-delete after setting desired env variables. One wrinkle is the variety of shells that people might have set up as default in Terminal. csh/tcsh don't use "export". The new "dash" shell in Catalina does not have a "source" command. All this needs to be solved to provide seamless experience.

abra-code commented 5 years ago

Implemented by this change: https://github.com/abra-code/OMC/commit/ee73f9abcdd6d20cde7a9ecb2796531adedc9140