Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variable for 3mux #34

Closed
flipcoder opened this issue Apr 13, 2020 · 5 comments
Closed

Environment variable for 3mux #34

flipcoder opened this issue Apr 13, 2020 · 5 comments

Comments

@flipcoder
Copy link
Contributor

It might be useful to have an environment variable for 3mux, similar to $TMUX so scripts can know if they're running inside 3mux:

I've added one here:

https://github.com/flipcoder/3mux/blob/master/shell.go#L25

Ideally you'd want it to be some path or number of the current pane/window, but for now I just made it 1.

@aaronjanse
Copy link
Owner

This sounds useful, thanks! Would you mind listing a few use-cases for $THREEMUX that I could put in 3mux's documentation?

@flipcoder
Copy link
Contributor Author

flipcoder commented Apr 13, 2020

Sure. The first thing I thought of is people may want to change their shell prompt to show they're inside 3mux. This would be more useful in the future if there's a way to hide the bottom bar. This may help a bit with compatibility issues as well: a .vimrc may need to check this to change a setting or a plugin may want to load some 3mux integration. It's mostly for future/integration things.

Probably the most common use would be to autostart 3mux in their bashrc/zshrc, in which case this should prevent recursion:

if [ -z "$THREEMUX" ]; then
    3mux          
fi   

This is commonly done with tmux.

@aaronjanse
Copy link
Owner

Awesome! Please open a Pull Request so I can merge your addition to shell.go

@aaronjanse
Copy link
Owner

I'll keep this open until I document this

@aaronjanse
Copy link
Owner

Fixed in v0.3.0.

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

No branches or pull requests

2 participants