Closed benyanke closed 2 years ago
I should note - I haven't updated tests for this yet, but if you like the idea and the implementation, I can do that.
Hey. Please lt me know if you have time to finish this :) Otherwise I can take it
Sorry I didn't get around to finishing this up for you, but it looks awesome! Thanks for taking my idea and half-implementation and running with it.
This PR closes #84.
It accomplishes this with two main changes:
Env Vars
It adds three env vars to all smug-created tmux sessions.
$SMUG_SESSION
- always equal to "true". Allows users to do easier scripting and detection if it's a smug-managed session$SMUG_SESSION_NAME
- name of the tmux session smug created$SMUG_SESSION_CONFIG_PATH
- full filepath of the smug config file that created this sessionConfig parser
If the
--file
arg is not specified, but$SMUG_SESSION_CONFIG_PATH
is set, the value of the env var is put into the--file
value variable, allowing all normal commands that would work with--file
manually specified to work automatically within a smug session. This lets smug be aware of it's current context if existing within a smug session, and operate on it by default unless you force it to do something else. For example,smug stop
orsmug edit
work without any additional args.