小编Bit*_*low的帖子

tmux 没有服务器在 /tmp/tmux-*/default - Windows msys2 终端上运行

我是 tmux 的新手,一直在尝试获得.tmux.conf适合我的并构建脚本来设置会话。在某些时候,我开始收到此错误

no server running on /tmp/tmux-1065767/default
Run Code Online (Sandbox Code Playgroud)

此消息仅在没有活动会话并且我运行类似tmux ls.


我试图遵循这样的解决方案,但我在一台 Windows 8 机器上,*nix 命令不起作用,我未能找到等价物。该链接中的相关部分是获取 PIDps并用于kill -SIGUSR1启动在其上运行的服务器/tmp/tmux-*/default:

% ps aux | grep -w [t]mux
root     14799  0.2  0.0  36020   488 ?        Ss   May08  51:30 tmux
% kill -USR1 14799
% tmux ls
<list of tmux sessions>
Run Code Online (Sandbox Code Playgroud)

如果您在 msys2 或 Git Bash 终端中知道与上述 Windows 8 等效的命令,我将不胜感激。


如果我的.tmux.conf或安装脚本有问题,我将它们包含在下面。

配置文件:

# allow names to stick
set-option -g allow-rename off …
Run Code Online (Sandbox Code Playgroud)

windows terminal tmux msys2

8
推荐指数
1
解决办法
1万
查看次数

set()不删除重复项

我正在尝试使用正则表达式在文件中找到唯一的IP地址实例.我发现它们很好并尝试将它们附加到列表中,然后尝试set()在我的列表中使用以删除重复项.我发现每个项目都没问题并且有重复但我无法让列表简化.打印我的设置的输出与打印ips作为列表相同,没有删除任何内容.

ips = [] # make a list
count = 0
count1 = 0
for line in f: #loop through file line by line
    match = re.search("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", line) #find IPs
    if match: #if there's a match append and keep track of the total number of Ips
        ips.append(match) #append to list
        count = count + 1
ipset = set(ips)
print(ipset, count)
Run Code Online (Sandbox Code Playgroud)

<_sre.SRE_Match object; span=(0, 13), match='137.43.92.119'>在尝试set()列表之前和之后,此字符串在输出中显示60次以上

python regex list set python-3.x

3
推荐指数
1
解决办法
577
查看次数

标签 统计

list ×1

msys2 ×1

python ×1

python-3.x ×1

regex ×1

set ×1

terminal ×1

tmux ×1

windows ×1