我刚刚用 编译了自己的版本tmux
。libevent
每当我从 zsh 运行 tmux 时,tmux 都会启动,但很快就会退出并返回[exited]
。我读到这里问题可能是我的default-command
,的配置default-shell
,但我的主目录中没有.tmux.conf
文件,并且据我所知,系统上没有安装 tmux 版本。
但有趣的是,tmux 可以正确运行:
tmux new $SHELL
我也尝试过创建一个空的,.tmux.conf
但没有成功,并且tmux -v
不输出任何其他内容。
有什么想法吗?
附加信息 1/3:
下面是最后几行strace -f tmux
[pid 30927] writev(6, [{"\33[?1049h\33(B\33[m\33[?1l\33>\33[H\33[2J\33[?1"..., 976}, {" "..., 195}], 2) = 8
[pid 30927] close(6) = 0
[pid 30927] epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN|EPOLLOUT, {u32=8, u64=8}}) = 0
[pid 30927] epoll_ctl(3, EPOLL_CTL_DEL, 8, {EPOLLIN|EPOLLOUT, {u32=8, u64=8}}) = 0
[pid 30927] epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN|EPOLLOUT, {u32=8, u64=8}}) = 0
[pid 30927] clock_gettime(CLOCK_MONOTONIC, {3625108, 599513697}) = 0
[pid 30927] gettimeofday({1361992488, 675759}, NULL) = 0
[pid 30927] clock_gettime(CLOCK_MONOTONIC, {3625108, 599693697}) = 0
[pid 30927] gettimeofday({1361992488, 675933}, NULL) = 0
[pid 30927] epoll_wait(3, {{EPOLLOUT, {u32=8, u64=8}}}, 32, 692) = 1
[pid 30927] clock_gettime(CLOCK_MONOTONIC, {3625108, 599962697}) = 0
[pid 30927] gettimeofday({1361992488, 676202}, NULL) = 0
[pid 30927] epoll_ctl(3, EPOLL_CTL_DEL, 8, {EPOLLIN|EPOLLOUT, {u32=8, u64=8}}) = 0
[pid 30927] sendmsg(8, {msg_name(0)=NULL, msg_iov(1)=[{"\4\0\0\0\20\0\0\0\7\0\0\0\377\377\377\377", 16}], msg_controllen=0, msg_flags=0}, 0) = 16
[pid 30909] <... epoll_wait resumed> {{EPOLLIN, {u32=7, u64=7}}}, 32, 4294967295) = 1
[pid 30927] epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN, {u32=8, u64=8}} <unfinished ...>
[pid 30909] clock_gettime(CLOCK_MONOTONIC, <unfinished ...>
[pid 30927] <... epoll_ctl resumed> ) = 0
[pid 30909] <... clock_gettime resumed> {3625108, 600611697}) = 0
[pid 30927] clock_gettime(CLOCK_MONOTONIC, <unfinished ...>
[pid 30909] gettimeofday( <unfinished ...>
[pid 30927] <... clock_gettime resumed> {3625108, 600777697}) = 0
[pid 30909] <... gettimeofday resumed> {1361992488, 676953}, NULL) = 0
[pid 30927] gettimeofday( <unfinished ...>
[pid 30909] epoll_ctl(3, EPOLL_CTL_DEL, 7, {EPOLLIN, {u32=7, u64=7}} <unfinished ...>
[pid 30927] <... gettimeofday resumed> {1361992488, 677094}, NULL) = 0
[pid 30909] <... epoll_ctl resumed> ) = 0
[pid 30927] clock_gettime(CLOCK_MONOTONIC, <unfinished ...>
[pid 30909] recvmsg(7, <unfinished ...>
[pid 30927] <... clock_gettime resumed> {3625108, 601290697}) = 0
[pid 30927] gettimeofday( <unfinished ...>
[pid 30909] <... recvmsg resumed> {msg_name(0)=NULL, msg_iov(1)=[{"\4\0\0\0\20\0\0\0\7\0\0\0\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 65535}], msg_controllen=0, msg_flags=0}, 0) = 16
[pid 30927] <... gettimeofday resumed> {1361992488, 677801}, NULL) = 0
[pid 30909] epoll_wait(3, <unfinished ...>
[pid 30927] epoll_wait(3, <unfinished ...>
[pid 30909] <... epoll_wait resumed> {}, 32, 0) = 0
[pid 30909] clock_gettime(CLOCK_MONOTONIC, {3625108, 601921697}) = 0
[pid 30909] gettimeofday({1361992488, 678171}, NULL) = 0
[pid 30909] fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
[pid 30909] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b4474914000
[pid 30909] write(1, "[exited]\n", 9[exited]
) = 9
[pid 30909] getppid() = 30904
[pid 30909] fcntl(0, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
[pid 30909] fcntl(0, F_SETFL, O_RDWR|O_LARGEFILE) = 0
[pid 30909] exit_group(0) = ?
<... epoll_wait resumed> {{EPOLLIN|EPOLLHUP, {u32=8, u64=8}}}, 32, 691) = 1
clock_gettime(CLOCK_MONOTONIC, {3625108, 604208697}) = 0
gettimeofday({1361992488, 680447}, NULL) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 8, {EPOLLIN, {u32=8, u64=8}}) = 0
recvmsg(8, {msg_name(0)=NULL, msg_iov(1)=[{"\5\0\0\0\20\0\0\0\7\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\0\0\177\0\0"..., 65535}], msg_controllen=0, msg_flags=0}, 0) = 0
close(8) = 0
close(9) = 0
close(10) = 0
close(11) = 0
close(12) = 0
close(13) = 0
close(14) = 0
close(15) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 7, {EPOLLIN, {u32=7, u64=7}}) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN, {u32=7, u64=7}}) = 0
stat("/tmp/tmux-4887/default", {st_mode=S_IFSOCK|0770, st_size=0, ...}) = 0
chmod("/tmp/tmux-4887/default", 0140660) = 0
exit_group(0) = ?
Process 30927 detached
附加信息 2/3:
cat tmux-server-23582.log
以下是from的输出tmux -v
:
> cat tmux-server-23590.log
server started, pid 23590
socket path /tmp/tmux-4887/default
new client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 14 from client 8
got 6 from client 8
got 0 from client 8
new term: xterm-256color
xterm-256color override: colors 256
xterm-256color override: XT
xterm-256color override: Ms ]52;%p1%s;%p2%s
xterm-256color override: Cc
xterm-256color override: Cr ]112
xterm-256color override: Cs [%p1%d q
xterm-256color override: Csr [2 q
new key Oo: 0x1021 (KP/)
new key Oj: 0x1022 (KP*)
new key Om: 0x1023 (KP-)
new key Ow: 0x1024 (KP7)
new key Ox: 0x1025 (KP8)
new key Oy: 0x1026 (KP9)
new key Ok: 0x1027 (KP+)
new key Ot: 0x1028 (KP4)
new key Ou: 0x1029 (KP5)
new key Ov: 0x102a (KP6)
new key Oq: 0x102b (KP1)
new key Or: 0x102c (KP2)
new key Os: 0x102d (KP3)
new key OM: 0x102e (KPEnter)
new key Op: 0x102f (KP0)
new key On: 0x1030 (KP.)
new key OA: 0x101d (Up)
new key OB: 0x101e (Down)
new key OC: 0x1020 (Right)
new key OD: 0x101f (Left)
new key [A: 0x101d (Up)
new key [B: 0x101e (Down)
new key [C: 0x1020 (Right)
new key [D: 0x101f (Left)
new key Oa: 0x501d (C-Up)
new key Ob: 0x501e (C-Down)
new key Oc: 0x5020 (C-Right)
new key Od: 0x501f (C-Left)
new key [a: 0x901d (S-Up)
new key [b: 0x901e (S-Down)
new key [c: 0x9020 (S-Right)
new key [d: 0x901f (S-Left)
new key [11^: 0x5002 (C-F1)
new key [12^: 0x5003 (C-F2)
new key [13^: 0x5004 (C-F3)
new key [14^: 0x5005 (C-F4)
new key [15^: 0x5006 (C-F5)
new key [17^: 0x5007 (C-F6)
new key [18^: 0x5008 (C-F7)
new key [19^: 0x5009 (C-F8)
new key [20^: 0x500a (C-F9)
new key [21^: 0x500b (C-F10)
new key [23^: 0x500c (C-F11)
new key [24^: 0x500d (C-F12)
new key [25^: 0x500e (C-F13)
new key [26^: 0x500f (C-F14)
new key [28^: 0x5010 (C-F15)
new key [29^: 0x5011 (C-F16)
new key [31^: 0x5012 (C-F17)
new key [32^: 0x5013 (C-F18)
new key [33^: 0x5014 (C-F19)
new key [34^: 0x5015 (C-F20)
new key [2^: 0x5016 (C-IC)
new key [3^: 0x5017 (C-DC)
new key [7^: 0x5018 (C-Home)
new key [8^: 0x5019 (C-End)
new key [6^: 0x501a (C-NPage)
new key [5^: 0x501b (C-PPage)
new key [11$: 0x9002 (S-F1)
new key [12$: 0x9003 (S-F2)
new key [13$: 0x9004 (S-F3)
new key [14$: 0x9005 (S-F4)
new key [15$: 0x9006 (S-F5)
new key [17$: 0x9007 (S-F6)
new key [18$: 0x9008 (S-F7)
new key [19$: 0x9009 (S-F8)
new key [20$: 0x900a (S-F9)
new key [21$: 0x900b (S-F10)
new key [23$: 0x900c (S-F11)
new key [24$: 0x900d (S-F12)
new key [25$: 0x900e (S-F13)
new key [26$: 0x900f (S-F14)
new key [28$: 0x9010 (S-F15)
new key [29$: 0x9011 (S-F16)
new key [31$: 0x9012 (S-F17)
new key [32$: 0x9013 (S-F18)
new key [33$: 0x9014 (S-F19)
new key [34$: 0x9015 (S-F20)
new key [2$: 0x9016 (S-IC)
new key [3$: 0x9017 (S-DC)
new key [7$: 0x9018 (S-Home)
new key [8$: 0x9019 (S-End)
new key [6$: 0x901a (S-NPage)
new key [5$: 0x901b (S-PPage)
new key [11@: 0xd002 (C-S-F1)
new key [12@: 0xd003 (C-S-F2)
new key [13@: 0xd004 (C-S-F3)
new key [14@: 0xd005 (C-S-F4)
new key [15@: 0xd006 (C-S-F5)
new key [17@: 0xd007 (C-S-F6)
new key [18@: 0xd008 (C-S-F7)
new key [19@: 0xd009 (C-S-F8)
new key [20@: 0xd00a (C-S-F9)
new key [21@: 0xd00b (C-S-F10)
new key [23@: 0xd00c (C-S-F11)
new key [24@: 0xd00d (C-S-F12)
new key [25@: 0xd00e (C-S-F13)
new key [26@: 0xd00f (C-S-F14)
new key [28@: 0xd010 (C-S-F15)
new key [29@: 0xd011 (C-S-F16)
new key [31@: 0xd012 (C-S-F17)
new key [32@: 0xd013 (C-S-F18)
new key [33@: 0xd014 (C-S-F19)
new key [34@: 0xd015 (C-S-F20)
new key [2@: 0xd016 (C-S-IC)
new key [3@: 0xd017 (C-S-DC)
new key [7@: 0xd018 (C-S-Home)
new key [8@: 0xd019 (C-S-End)
new key [6@: 0xd01a (C-S-NPage)
new key [5@: 0xd01b (C-S-PPage)
new key OP: 0x1002 (F1)
new key OQ: 0x1003 (F2)
new key OR: 0x1004 (F3)
new key OS: 0x1005 (F4)
new key [15~: 0x1006 (F5)
new key [17~: 0x1007 (F6)
new key [18~: 0x1008 (F7)
new key [19~: 0x1009 (F8)
new key [20~: 0x100a (F9)
new key [21~: 0x100b (F10)
new key [23~: 0x100c (F11)
new key [24~: 0x100d (F12)
new key O2P: 0x100e (F13)
new key O2Q: 0x100f (F14)
new key O2R: 0x1010 (F15)
new key O2S: 0x1011 (F16)
new key [15;2~: 0x1012 (F17)
new key [17;2~: 0x1013 (F18)
new key [18;2~: 0x1014 (F19)
new key [19;2~: 0x1015 (F20)
new key [2~: 0x1016 (IC)
new key [3~: 0x1017 (DC)
new key OH: 0x1018 (Home)
new key OF: 0x1019 (End)
new key [6~: 0x101a (NPage)
new key [5~: 0x101b (PPage)
new key [Z: 0x101c (BTab)
replacing key OA: 0x101d (Up)
replacing key OB: 0x101e (Down)
replacing key OD: 0x101f (Left)
replacing key OC: 0x1020 (Right)
new key [3;2~: 0x9017 (S-DC)
new key [1;2B: 0x901e (S-Down)
new key [1;5B: 0x501e (C-Down)
new key [1;6B: 0xd01e (C-S-Down)
new key [1;2F: 0x9019 (S-End)
new key [1;2H: 0x9018 (S-Home)
new key [2;2~: 0x9016 (S-IC)
new key [1;2D: 0x901f (S-Left)
new key [1;5D: 0x501f (C-Left)
new key [1;6D: 0xd01f (C-S-Left)
new key [6;2~: 0x901a (S-NPage)
new key [5;2~: 0x901b (S-PPage)
new key [1;2C: 0x9020 (S-Right)
new key [1;5C: 0x5020 (C-Right)
new key [1;6C: 0xd020 (C-S-Right)
new key [1;2A: 0x901d (S-Up)
new key [1;5A: 0x501d (C-Up)
new key [1;6A: 0xd01d (C-S-Up)
session 0 created
writing 8 to client 8
keys are 12 ([>1;3400;0c)
received xterm version 3400
input_parse: '/' ground
input_parse: 'h' ground
input_parse: 'o' ground
input_parse: 'm' ground
input_parse: 'e' ground
input_parse: '/' ground
input_parse: 'j' ground
input_parse: 'o' ground
input_parse: 'h' ground
input_parse: 'n' ground
input_parse: '/' ground
input_parse: '.' ground
input_parse: 'z' ground
input_parse: 'p' ground
input_parse: 'r' ground
input_parse: 'o' ground
input_parse: 'f' ground
input_parse: 'i' ground
input_parse: 'l' ground
input_parse: 'e' ground
input_parse: ':' ground
input_parse: '2' ground
input_parse: ':' ground
input_parse: ' ' ground
input_parse: 'n' ground
input_parse: 'o' ground
input_parse: ' ' ground
input_parse: 's' ground
input_parse: 'u' ground
input_parse: 'c' ground
input_parse: 'h' ground
input_parse: ' ' ground
input_parse: 'f' ground
input_parse: 'i' ground
input_parse: 'l' ground
input_parse: 'e' ground
input_parse: ' ' ground
input_parse: 'o' ground
input_parse: 'r' ground
input_parse: ' ' ground
input_parse: 'd' ground
input_parse: 'i' ground
input_parse: 'r' ground
input_parse: 'e' ground
input_parse: 'c' ground
input_parse: 't' ground
input_parse: 'o' ground
input_parse: 'r' ground
input_parse: 'y' ground
input_parse: ':' ground
input_parse: ' ' ground
input_parse: '/' ground
input_parse: 'n' ground
input_parse: '/' ground
input_parse: 's' ground
input_parse: 'w' ground
input_parse: '/' ground
input_parse: 'z' ground
input_parse: 's' ground
input_parse: 'h' ground
input_parse: '-' ground
input_parse: '4' ground
input_parse: '.' ground
input_parse: '3' ground
input_parse: '.' ground
input_parse: '1' ground
input_parse: '4' ground
input_parse: '/' ground
input_parse: 'b' ground
input_parse: 'i' ground
input_parse: 'n' ground
input_parse: '/' ground
input_parse: 'z' ground
input_parse: 's' ground
input_parse: 'h' ground
' groundrse: '
input_c0_dispatch: '
input_parse: '
' ground
input_c0_dispatch: '
session 0 destroyed
writing 3 to client 8
got 5 from client 8
writing 4 to client 8
lost client 8
附加信息 3/3:
cat tmux-client-23582.log
下面是from的输出tmux -v
:
cat tmux-client-23582.log 从服务器获取 8 从服务器获取 3 从服务器获取 4
答案1
详细日志记录中的行input_parse
显示了初始命令的输出多路复用器正在运行。不过,当它们像这样一次显示一个字符时,可能很难读取它们。以下是重新组合的输出:
/home/john/.zprofile:2: no such file or directory: /n/sw/zsh-4.3.14/bin/zsh
多路复用器为其默认命令启动登录 shell。什么时候嘚作为登录 shell 启动,它会进行处理~/.zprofile
(如果存在)。您的此文件版本正在尝试运行一个不存在的文件:/n/sw/zsh-4.3.14/bin/zsh
。
您可能需要注释掉或调整~/.zprofile
文件中的某些内容。或者也许您需要安装预期的文件系统/n/sw
?
答案2
这似乎是由点文件中某处的语法错误引起的。常见的查看位置:(.zshrc
或.bashrc
、.bash_profile
等),当然还有.tmux.conf
。
就我而言,我忘记像这样加引号:
DISABLE_UPDATE_PROMPT=true
应该是DISABLE_UPDATE_PROMPT='true'