Closed flipcoder closed 4 years ago
This sounds useful, thanks! Would you mind listing a few use-cases for $THREEMUX that I could put in 3mux's documentation?
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.
Awesome! Please open a Pull Request so I can merge your addition to shell.go
I'll keep this open until I document this
Fixed in v0.3.0
.
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.