Skip to content

Instantly share code, notes, and snippets.

@ypcrts
Last active January 19, 2021 15:16
Show Gist options
  • Save ypcrts/842b3d828b0a3a5fada6d243387e0a48 to your computer and use it in GitHub Desktop.
Save ypcrts/842b3d828b0a3a5fada6d243387e0a48 to your computer and use it in GitHub Desktop.
tmux server connection refused
#!/bin/sh
#
# If your shell is returning an error on initialization, it makes tmux-server di.
# This gist shows how to work around that. Googling shows that this happens to
# zsh users a lot.
#
# `autoload: command not found`
# `bashcompinit: command not found`
# `server_signal: Child exited`
# `connect failed: Connection refused`
# c.f. https://github.com/tmux/tmux/issues/1639
printf 'set -g default-shell /bin/dash\nset -g default-command "exec /bin/bash --norc --noprofile"' > test
tmux kill-server; tmux kill-server ; tmux -f test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment