选择 tmux 窗口的方式是通过名称。

huangapple go评论52阅读模式
英文:

How to select a tmux window by name?

问题

I have several windows including r-emr_task, r-emr_task_bake and r-emr_task_fry:

$ tmux list-windows | grep r-emr_task
0: r-emr_task (1 panes) [94x22] [layout 5685,94x22,0,0,54] @54
32: r-emr_task_fry (1 panes) [142x32] [layout 5976,142x32,0,0,55] @55
41: r-emr_task (1 panes) [142x32] [layout d971,142x32,0,0,41] @41
43: r-emr_task_bake (1 panes) [142x32] [layout d973,142x32,0,0,43] @43
45: r-emr_task_fry (1 panes) [142x32] [layout d975,142x32,0,0,45] @45
56: r-emr_task_bake (1 panes) [142x32] [layout d975,142x32,0,0,64] @64
$

If I try to switch to the r-emr_task window by using the ' command, and then entering r-emr_task, I get the error: Can't find window: r-emr_task.

So what I end up doing is using the " command and the /r-emr_task to search for the window and press ENTER to select it.

Why doesn't the ' command work? The tmux man page says:

   '           Prompt for a window index to select.

I've also tried ' followed by =r-emr_task to select exactly that window. I also tried =0:r-emr_task to include the session name. No go.

英文:

I have several windows including r-emr_task, r-emr_task_bake and r-emr_task_fry:

$ tmux list-windows | grep r-emr_task
0: r-emr_task (1 panes) [94x22] [layout 5685,94x22,0,0,54] @54
32: r-emr_task_fry (1 panes) [142x32] [layout 5976,142x32,0,0,55] @55
41: r-emr_task (1 panes) [142x32] [layout d971,142x32,0,0,41] @41
43: r-emr_task_bake (1 panes) [142x32] [layout d973,142x32,0,0,43] @43
45: r-emr_task_fry (1 panes) [142x32] [layout d975,142x32,0,0,45] @45
56: r-emr_task_bake (1 panes) [142x32] [layout d975,142x32,0,0,64] @64
$

If I try to switch to the r-emr_task window by using the ' command, and then entering r-emr_task, I get the error: Can't find window: r-emr_task.

So what I end up doing is using the " command and the /r-emr_task to search for the window and press ENTER to select it.

Why doesn't the ' command work? The tmux man page says:

> ' Prompt for a window index to select.

I've also tried ' followed by =r-emr_task to select exactly that window. I also tried =0:r-emr_task to include the session name. No go.

答案1

得分: 1

因为您有两个具有相同名称“r-emr_task”的窗口。C-b ' 期望“索引”只匹配一个窗口。

 0: r-emr_task (1 panes) [94x22] [layout 5685,94x22,0,0,54] @54
41: r-emr_task (1 panes) [142x32] [layout d971,142x32,0,0,41] @41
英文:

It's because you have two windows with the same name r-emr_task. C-b ' expects that the "index" matches only one window.

 0: r-emr_task (1 panes) [94x22]  [layout 5685,94x22,0,0,54]  @54
41: r-emr_task (1 panes) [142x32] [layout d971,142x32,0,0,41] @41

huangapple
  • 本文由 发表于 2023年4月7日 04:05:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75953356.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定