【发布时间】:2016-11-22 23:21:12
【问题描述】:
文件~/.tmux.conf
new-session -n terminal
通过命令运行 tmux:
tmux
结果:在会话列表中找到两个会话(ctrl+b s 检查)
(0) + 1: 1 windows (attached)
(1) + terminal: 1 windows
我只想拥有我在配置文件中定义的 terminal 会话。
【问题讨论】:
标签: tmux
文件~/.tmux.conf
new-session -n terminal
通过命令运行 tmux:
tmux
结果:在会话列表中找到两个会话(ctrl+b s 检查)
(0) + 1: 1 windows (attached)
(1) + terminal: 1 windows
我只想拥有我在配置文件中定义的 terminal 会话。
【问题讨论】:
标签: tmux
(0) + 1: 1 windows (attached) - 由tmux 命令创建的第一个会话。
然后 tmux 加载配置并再创建一个会话 (1) + terminal: 1 windows 因为您在 .tmux.conf
new-session -n terminal 行
要创建一个会话,从 .tmux.conf 中删除 new-session -n terminal 并将 tmux 启动为 tmux 或 tmux new -s session_name
【讨论】:
所以我创建了一个脚本,它省略了创建额外会话(仅在配置中定义的那些)
#!/bin/sh
tmux -2 attach-session -d
【讨论】: