文章目录
前言
tmux解绑会话与终端,通过ssh远程连接的时候可以通过tmux保留会话,这样一些输出或运行的程序在断开连接后依然可以保留。
quick start
tmux new -s demo # 新建一个名称为demo的会话
tmux a -t demo # 进入到名称为demo的会话
快捷键Ctrl+b d 退出
下面网站给了很多快捷键:
https://cloud.tencent.com/developer/article/1375208
https://www.ruanyifeng.com/blog/2019/10/tmux.html
需要按住shift才能使用鼠标右键菜单复制粘贴。
配置tmux鼠标滑轮,首先clone代码:
git clone https://github.com/NHDaly/tmux-better-mouse-mode
然后编辑tmux配置文件:vim ~/.tmux.conf
,输入:
set-option -g mouse on
run-shell ~/tmux-better-mouse-mode/scroll_copy_mode.tmux
set -g @scroll-speed-num-lines-per-scroll 10
更新tmux配置:
tmux source-file ~/.tmux.conf
OK