在创建我的 tmux 会话时不小心使用了 -S 而不是 -s,我的会话在哪里?
Accidentally used -S when creating my tmux session instead of -s, where is my session?
我创建了一个新的tmux会话,打算使用-s标志来命名它,但混淆了命令与指定套接字的-S。我知道会话还活着,因为我在其中启动的进程仍然 运行。但是当我尝试列出 运行 会话时,它没有出现。我的会话在哪里以及如何恢复它?
在tmux
选项中-S
表示套接字路径(来自man tmux
):
-S socket-path
Specify a full alternative path to the server socket. If -S is specified, the default
socket directory is not used and any -L flag is ignored.
所以你必须找出 tmux
是 运行 的父目录
-S
选项并将此选项传递给 tmux
以将其指向
备用套接字路径。例如,您可以找到 PID
tmux
进程:
$ ps aux | grep '[t]mux'
ja 15121 0.0 0.0 20252 2236 pts/6 S+ 00:44 0:00 tmux -S new
然后在 /proc
中检查此过程 cwd
,如下所示:
$ ls -l /proc/15121/cwd
lrwxrwxrwx 1 ja users 0 Aug 19 00:52 /proc/15121/cwd -> /home/ja
然后参考这个 tmux
会话:
$ tmux -S /home/ja/new ls
0: 1 windows (created Sat Aug 19 00:44:46 2017) [212x65] (attached)
我创建了一个新的tmux会话,打算使用-s标志来命名它,但混淆了命令与指定套接字的-S。我知道会话还活着,因为我在其中启动的进程仍然 运行。但是当我尝试列出 运行 会话时,它没有出现。我的会话在哪里以及如何恢复它?
在tmux
选项中-S
表示套接字路径(来自man tmux
):
-S socket-path
Specify a full alternative path to the server socket. If -S is specified, the default
socket directory is not used and any -L flag is ignored.
所以你必须找出 tmux
是 运行 的父目录
-S
选项并将此选项传递给 tmux
以将其指向
备用套接字路径。例如,您可以找到 PID
tmux
进程:
$ ps aux | grep '[t]mux'
ja 15121 0.0 0.0 20252 2236 pts/6 S+ 00:44 0:00 tmux -S new
然后在 /proc
中检查此过程 cwd
,如下所示:
$ ls -l /proc/15121/cwd
lrwxrwxrwx 1 ja users 0 Aug 19 00:52 /proc/15121/cwd -> /home/ja
然后参考这个 tmux
会话:
$ tmux -S /home/ja/new ls
0: 1 windows (created Sat Aug 19 00:44:46 2017) [212x65] (attached)