I'm trying to use tmux on my computer and it runs perfectly as root, but I'd rather run it under my own account. When I run it with my account, I get a variety of error messages that include "Cannot establish any listening sockets" and another message that "Server is already active for display 0". I try to follow the instructions inside the error messages but it just brings me in circles. Let me know what I should try or what other information I should post. I'm a first timer here, so I might make mistakes with this post.
My guess is, you've tried to set up your
.bash_profile) to automatically start Xorg on login. The problem is, each tmux window runs the
.profile scripts again, and tries to start Xorg inside Xorg. So if that's the case, you need to add additional checks.
For example, if you have the
startx command in ~/.profile, replace it with:
if [ "$(tty)" = /dev/tty1 ]; then startx fi
This will run startx only when logging in to the 1st text console (tty1). It doesn't just fix tmux, but also fixes SSH and "display managers" like GDM & LightDM, as well as avoiding duplicate Xorgs in general.