Skip to content

Conversation

@tasdomas
Copy link
Contributor

Added new config directive 'environment', that lists environment variables to be set on the tmux session. Needs tests and documentation, but feedback if the general approach seems sensible would be very useful.

tmuxp/session.py Outdated
if isinstance(proc.stderr, list) and len(proc.stderr) == int(1):
proc.stderr = proc.stderr[0]
raise ValueError('tmux set-environment stderr: %s' % proc.stderr)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the documentation

@tony
Copy link
Member

tony commented Feb 12, 2016

Good call on this @tasdomas

I opened a question at tmux/tmux#304 to double check if set-environment with -g is just server only. If so we may want to chuck a set_environment to the server as well.

Tests / documentation / examples for this would be a good idea. It seems like a feature that'd be helpful in many situations.

@tasdomas
Copy link
Contributor Author

@tony, cool - I'll update the pull request and submit it for your consideration.

@tony
Copy link
Member

tony commented Feb 18, 2016

We probably should also add set_environment at the server level. -g / "global" is the same as server.

Any updates on this @tasdomas? If you're having trouble / time constraints let me know.

@tasdomas
Copy link
Contributor Author

@tony, working on it - currently trying to figure out a way to test the functionality. Once that's done, everything else is relatively easy. Should have a PR by next week - a little busy at the moment.

@tony
Copy link
Member

tony commented Feb 18, 2016

No problem, if you need help or need me to finish the test part, I'm happy to.

@tasdomas
Copy link
Contributor Author

Hello, @tony, I've updated the pull request. Extended the functionality to support setting global variables on the server as well, added some docs and enabled environment variable expansion for the variables (so setting something like PATH would be less tedious). Looking forward to your reviews.

tony added a commit that referenced this pull request Feb 29, 2016
@tony tony merged commit 460672d into tmux-python:master Feb 29, 2016
@tony
Copy link
Member

tony commented Feb 29, 2016

@tasdomas: Pardon the delay. Merged.

This looks good to me and is useful enough of a feature to bump the version up.

Uploaded to pypi as 0.11.0.

@coveralls
Copy link

coveralls commented Feb 2, 2018

Coverage Status

Coverage decreased (-23.5%) to 39.531% when pulling aafa0de on tasdomas:set_environment_support into 0a8568d on tony:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants