标签: tmux

用于在 OS X 上的 iTerm2 中切换 tmux 中的窗格的键盘快捷键

我在 OS X 上随 iTerm2 安装了 tmux。

虽然我可以Cmd+left/right在选项卡之间切换,但我似乎无法按照其他人的建议使用Ctl+b o(即,Controlb在一起,后跟一个?)在同一选项卡下的窗格之间切换。o

我认为我没有触及 tmux 的任何默认键绑定,那么此操作的正确键盘快捷键是什么?

tmux iterm2 macos

5
推荐指数
1
解决办法
9608
查看次数

Ctrl-C 在 tmux 窗口中不起作用

我有一个 Mini2440 ARM 板,并且我使用multistrap.

我曾经tmux在不同的窗口中运行多个进程/etc/rc.local。我使用串行端口连接到开发板,并使用 inittab 条目在该端口上运行getty。我用作picocom串行通信器。

当 root 登录时,~/.bashrc将其附加到已经运行的 tmux 服务器,并且可以轻松监控进程。实际的命令是exec tmux attach-session -t "main". tmux 使用默认配置运行。

一切正常,除了其中一个进程( 周围的 shell 脚本pppd)没有从终端接收 Ctrl-C,而其他进程却接收到。Ctrl-\ 也有效。也kill -INT <pppd_pid>有效,但kill -INT <shellscript_pid>没有。

我真的需要 Ctrl-C 才能工作。这个设置有什么问题吗?

linux debian terminal tmux

5
推荐指数
0
解决办法
2076
查看次数

tmux 鼠标同时选择和滚动?

当在 tmux 中处于复制模式时,有没有办法使用鼠标选择文本,并同时向上滚动窗口?选择文本时,当我到达顶部边界时,缓冲区不会向上滚动。

set-window-option -g mode-mouse on在我的/.tmux.conf

tmux

5
推荐指数
1
解决办法
5346
查看次数

将 tmux 标题设置为路径

我当前正在设置 tmux,通过执行以下操作将窗口标题更新为当前运行命令的名称:

set-option -g set-titles on
set-option -g set-titles-string '#S:#I.#P #W' # window number,program name,active (or not)
set-window-option -g automatic-rename on      # auto name
Run Code Online (Sandbox Code Playgroud)

但是,当没有执行命令时,它只显示“N:zsh”(其中N是窗口号)。

有没有办法在没有执行命令时在窗口标题中显示路径的当前最后一个元素?因此,如果当前路径是/usr/src/linux,则窗口标题应为“N:linux”。

谢谢

tmux

5
推荐指数
1
解决办法
2539
查看次数

tmux 启动时自动分割窗口

我有一个类似于这个人的问题/sf/ask/392643471/但更具体。

我想在单个 tmux.conf 文件中执行此操作,无需任何键绑定来根据 @jasonwryan 的答案加载特定会话。

那么,我该怎么做呢?我设置了 tmux.conf:

new  -s mySession -n myWindow
neww -n foo/bar foo
splitw -v -p 50 -t 0 bar
selectw -t 1 
selectp -t 0
Run Code Online (Sandbox Code Playgroud)

但当我启动 tmux 时它不会分割窗口。


更新:我认为附件不起作用。如果我放弃第二个“foo”窗口并简化我的 tmux.conf :

# set panes the way I want them
# if I started tmux by just running 'tmux' in command line, it automatically creates session(0) so...

new -s mySession -n myWindow    # ... create new session (1) with new window (0)
select-window -t …
Run Code Online (Sandbox Code Playgroud)

tmux

5
推荐指数
1
解决办法
3574
查看次数

我如何启动一个完全独立的 tmux 新实例?

如果我已经打开了一个 tmux 会话,结果是我无法使用另一个 tmux 配置启动新的会话,即:

$ tmux # loads new session using ~/.tmux.conf
Run Code Online (Sandbox Code Playgroud)

在另一个航站楼...

$ tmux -f another.tmux.conf
( load the same tmux configuration )
Run Code Online (Sandbox Code Playgroud)

我尝试使用tmux -f another.tmux.conf new-session -s another,但它也不起作用。

linux terminal tmux

5
推荐指数
1
解决办法
2281
查看次数

在 tmux 中,我可以使用“exit”退出包含的终端窗口而不是会话本身吗?

因此,当我打开一个新终端(我在 Arch Linux 上使用 terminator)时,我将其配置为要么打开一个新tmux会话(如果会话不存在),要么附加到现有会话。当我exit在提示符下输入时,它会退出 tmux 会话。我必须exit再次输入才能退出终端。我想要的是,输入exit一次将退出终端,但保持tmux运行状态,因此下次我打开终端时,它将重新连接到上一个tmux会话。本质上,这相当于单击窗口管理器的退出按钮,但我希​​望在键入 时使用此功能exit

编辑:

这就像我想要的:

alias exit='if [[ $TMUX = "" ]]; then exit; else tmux detach; exit; fi'
Run Code Online (Sandbox Code Playgroud)

但问题是应该在包含 tmux 会话的终端中调用exit之后,而不是 tmux 会话本身。tmux detach

linux terminal bash tmux

5
推荐指数
2
解决办法
4651
查看次数

在 tmux 中如何退出命令提示符而不输入无效命令?

我不知道如何退出命令提示符状态,有时当我点击 时,我会进入命令提示符状态cntrl+b :。当我要切换窗格然后想进入 vim 命令提示符但最终进入 tmux 时,我有时会意外地这样做。现在我输入无意义的内容并按回车键,但我只想逃避。退出键不执行此操作。还有别的办法吗?

tmux

5
推荐指数
1
解决办法
4298
查看次数

tmux 不使用默认 shell

我的 tmux 开始出现短暂的奇怪行为。今天我注意到我的 tmux 会话不是以 bash shell 开头,而是以 ? 开头(不知道)。我看到的只是一美元$。然后如果我尝试调用 bashbash它会返回

sessions should be nested with care, unset $TMUX to force.
Run Code Online (Sandbox Code Playgroud)

没有 bash 的 tmux

我想在文件中添加default-shellfor tmux ~/.tmux.conf,但它不存在,如果我创建它,tmux 似乎看不到它。

bash shell tmux

5
推荐指数
1
解决办法
6128
查看次数

如何启用 tmux 滚动?

使用https://github.com/samoshkin/tmux-config主密钥是CTRL-a. 文档建议:

There is a root keybinding to enter Copy mode: M-Up. Once in copy mode, you have several scroll controls:

    scroll by line: M-Up, M-down
    scroll by half screen: M-PageUp, M-PageDown
    scroll by whole screen: PageUp, PageDown
    scroll by mouse wheel, scroll step is changed from 5 lines to 2
Run Code Online (Sandbox Code Playgroud)

但按下时我无法让它工作CTRL-A + M-Page*

tmux

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

标签 统计

tmux ×10

linux ×3

terminal ×3

bash ×2

debian ×1

iterm2 ×1

macos ×1

shell ×1