tmux:挂起并且不加载,并且不响应任何选项命令

发布于 2024-12-04 13:21:47 字数 192 浏览 1 评论 0原文

我已经在 Fedora 的本地空间上从源代码安装了 tmux。到目前为止,它运行良好。但突然无法再运行它,当运行 tmux 时,它就停止了。尝试了不同的命令选项,例如 ls-sessions,但没有任何效果。杀死我的用户的所有进程,删除 tmux 和 libevnet 的所有文件,然后从头开始重新安装它们。仍然相同,终端中的 tmux 命令只是冻结,没有任何实际错误。

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 command options like ls-sessions, none works. Killed all the processes of my user, deleted all the files of tmux and libevnet, and reinstalled them again from scratch. Still same, and tmux command in terminal just freezes without any actual error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

筱武穆 2024-12-11 13:21:47

我已经面对这个问题很长一段时间了,经过一番搜索后,我发现这是因为我不小心按下了 Ctrl+S (Ctrl< /kbd>+A+S 是我切换窗格的快捷方式),这会关闭终端中的流量控制并阻止终端接受输入。可以通过按 Ctrl+Q 重新启用它。

来源: https://superuser.com/a/553349/137226

I had faced this problem for a long time and after a bit of searching I figured out that this was being caused because I accidently hit Ctrl+S (Ctrl+A+S is my shortcut for switching panes), and this turns off flow control in terminals and stops the terminal from accepting input. It can be reenabled by pressing Ctrl+Q.

Source: https://superuser.com/a/553349/137226

救赎№ 2024-12-11 13:21:47

有一个类似的问题,我有一个带有两个缓冲区的 tmux 会话。我没有看到我输入的任何内容,但是当我在缓冲区之间切换时,我之前输入的内容会出现在屏幕上。 stty sane 不起作用。

我分离了 Ctrl-b+d,并注意到当我查看 tmux list-clients 时仍然附加了一个客户端。 tmux detach-client 删除了它,然后我可以重新连接,一切又恢复正常了。

Had a similar issue, where I had a tmux session with two buffers. I didn't see anything I typed, but when I switched between buffers what I had typed previously would appear onscreen. stty sane didn't work.

I detached Ctrl-b+d, and noticed that there was still a client attached when I looked at tmux list-clients. tmux detach-client removed it, and then I could reattach and the everything worked again.

夜清冷一曲。 2024-12-11 13:21:47

如果可以丢失会话,请尝试删除 /tmp 目录下的 tmux-NNNNNNN 目录,其中 NNNNNNN 是一个数字。根据tmux手册,如果设置了TMPDIR环境变量,则tmux-NNNNNNN将被放入TMPDIR中代码>.

tmux 将服务器套接字存储在 /tmp 下的目录中(或 TMPDIR,如果设置);

这解决了我无法运行与会话相关的 tmux 命令的问题。我也尝试了以下方法,但它们不起作用:

  • killall -9 tmux
  • 重新安装 tmux
  • 重新启动 shell 会话

我无法轻松重新启动操作系统,因为它是共享服务器管理的由其他人。

If it is ok to lose your sessions, try deleting the tmux-NNNNNNN directory, where NNNNNNN is a number, under your /tmp directory. According to the tmux manual, if the TMPDIR environment variable is set, the tmux-NNNNNNN will be put in the TMPDIR.

tmux stores the server socket in a directory under /tmp (or TMPDIR if set);

This solved my problem of not being able to run tmux commands that are related to sessions. I also tried the following, but they did not work:

  • killall -9 tmux
  • reinstall tmux
  • restart shell session

I could not easily restart the operating system, because it's a shared server managed by others.

-柠檬树下少年和吉他 2024-12-11 13:21:47

tmux 在我启动后就停止了。 Ctrl-QCtrl-C 没有执行任何操作。

修复了

killall -9 tmux

(可能是一个不同的问题,但这个问题出现在谷歌中。)

tmux was halting right after I started it. Ctrl-Q and Ctrl-C didn't do anything.

Fixed with

killall -9 tmux

(May be a different problem, but this question showed up in Google.)

北方的巷 2024-12-11 13:21:47

我有同样的问题。原因是 tmux 缓冲区已满,也可能是由于 tmux 会话有多个客户端而发生。

要解决此问题,您需要从会话中分离所有客户端,然后重新附加它。

我发现解决该问题的最佳方法是将以下功能添加到 ~/.bashrc 文件中:

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 <tmux_session_name>"
       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
}

然后运行 ​​source ~/.bashrc 在终端中进行这些更改。

现在附加会话类型:

reattach_client <session_name>

解决了我的问题。

感谢 Alex Zelichenko 帮助我解决这个问题!

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 <tmux_session_name>"
       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 <session_name>

solved my issue.

Thanks to Alex Zelichenko for help me with this!

[浮城] 2024-12-11 13:21:47

您应该能够通过以下一些测试来缩小问题范围:

  1. 从 X11 外部尝试一下:Ctrl+Alt+ F2(或从另一台计算机使用 ssh

  2. 测试其他终端模拟器是否工作: scriptscreen

  3. 尝试另一个复杂的终端应用程序: htopmc

  4. 重置您的 TTY设置:stty sane

  5. 检查您的终端是否已识别:echo $TERM(它应该是类似“xterm”或“linux”)

  6. 确保您的终端功能文件存在:< code>ls -lh /usr/share/terminfo/*/$TERM

You should be able to narrow down your problem a bit with a few of these tests:

  1. Give it a shot from outside X11: Ctrl+Alt+F2 (or use ssh from another computer)

  2. Test if other terminal emulators work: script and screen

  3. Try another complicated terminal application: htop and mc

  4. Reset your TTY settings: stty sane

  5. Check that your terminal identified: echo $TERM (it should be something like "xterm" or "linux")

  6. Make that your terminal capabilities file exists: ls -lh /usr/share/terminfo/*/$TERM

浮生面具三千个 2024-12-11 13:21:47

谢谢。
我发现了问题。 tmux进程处于D状态,我只好重启系统。
问题来自于 kerberos 票证在一段时间后过期。并找到一个解决这个问题的脚本:
https://iain.cx/src/ktmux/

Thanks.
I found the problem. The tmux process were in D state, and I had no choice but to reboot the system.
The problem came from kerberos ticket expiring after a while. And find a scripts that solves this problem:
https://iain.cx/src/ktmux/

千笙结 2024-12-11 13:21:47

一个不太激烈的操作(在终止 tmux 进程之前尝试)是通过 ssh 进入计算机并运行以下命令。

kill -CONT `pidof tmux`

来源:https://github.com/tmux/tmux/issues/507#问题评论-271502093

A less drastic action (to try before killing the tmux process) is to ssh into the machine and run the following command.

kill -CONT `pidof tmux`

Source: https://github.com/tmux/tmux/issues/507#issuecomment-271502093

掐死时间 2024-12-11 13:21:47

这发生在我身上,因为我不小心尝试创建两个同名的并行 tmux 会话。

对我有用的是输入 htop,检查创建会话的两个运行命令的 pid,并使用 kill -9 pid1kill - 终止这两个命令。 9 pid2

This happened to me because I accidentally tried to create two parallel tmux sessions with the same name.

What worked for me was to enter htop, checking pid's of the two running commands that created the sessions, and killing both by using kill -9 pid1 and kill -9 pid2

删除会话 2024-12-11 13:21:47

我需要跑

killall -9 'tmux: server'

I needed to run

killall -9 'tmux: server'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文