【问题标题】:new-session in tmux config starts two sessionstmux 配置中的 new-session 启动两个会话
【发布时间】: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


    【解决方案1】:

    (0) + 1: 1 windows (attached) - 由tmux 命令创建的第一个会话。

    然后 tmux 加载配置并再创建一个会话 (1) + terminal: 1 windows 因为您在 .tmux.conf

    中有 new-session -n terminal

    要创建一个会话,从 .tmux.conf 中删除 new-session -n terminal 并将 tmux 启动为 tmuxtmux new -s session_name

    【讨论】:

    • 我是这么想的。但是我想保留配置,因为我一次启动了几个预配置的会话。谢谢你的回复。
    【解决方案2】:

    所以我创建了一个脚本,它省略了创建额外会话(仅在配置中定义的那些)

    #!/bin/sh
    tmux -2 attach-session -d
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-17
      • 1970-01-01
      相关资源
      最近更新 更多