tmux: hangs and do not load, and do not respond to any option command

后端 未结 8 1722
粉色の甜心
粉色の甜心 2021-01-31 09:01

I have installed tmux from source on my localspace in Fedora. It was working nicely so far. But suddenly can not run it anymore, when run tmux, it just halts. Tried different co

8条回答
  •  独厮守ぢ
    2021-01-31 09:26

    I had the same issue. The cause is that the tmux buffer is full, and it also may happens cause of multi clients to the tmux session.

    To solve it you need to detach all the clients from the session, and reattach it.

    The best way I found to solve it is to add to the ~/.bashrc file this functions:

    check_params() {
           if [[ $1 < $2 ]]; then
                   echo -e "Usage:\n${3}"
                   ok=0
           else
                   ok=1
           fi
    
    }
    
    # detach all the clients from this session, and attach to it.
    reattach_client() {
           check_params $# 1 "reattach_client "
           if [[ $ok == 1 ]]; then
                   tmux list-client | grep $1 | awk '{split($1, s, ":"); print s[1]}' | xargs tmux detach-client -t | true
                   tmux attach -t $1
           fi
    }
    

    then run source ~/.bashrc to make these changes in the terminal.

    Now to attach the session type:

    reattach_client 
    

    solved my issue.

    Thanks to Alex Zelichenko for help me with this!

提交回复
热议问题