首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

tmux学习札记

2013-01-26 
tmux学习笔记tmux号称screen的替代品,来看看为什么这么说:支持多个window之间的粘贴/复制,可以选择粘贴缓

tmux学习笔记
tmux号称screen的替代品,来看看为什么这么说:
支持多个window之间的粘贴/复制,可以选择粘贴缓冲区,而这screen不支持。分屏操作完胜。screen只支持简陋的上下分屏,分屏后还需要ctrl+a+c才能创建一个新的终端。screen直接创建一个终端,且支持屏幕之间的切换/relocate/重定义大小,以及提供了一些预置的layouttmux默认自带status bar,screen还需手动配置tmux的配置比screen简单vi和emac模式绑定                                                    


启动tmux:
tmux ls: list tmux session
tmux attach: attach a tmux session

tmux启动参数:
-c: shell-command, 比如 tmux -c vim-f file: 指定配置文件,默认~/.tmux.conf,或者/etc/tmux.conf-L socket-name: 制定tmux session的名字-u: 支持utf-8-V: version

tmux的一些概念:

A session is a single collection of pseudo terminals under the management of tmux.  Each session has one or more
     windows linked to it.  A window occupies the entire screen and may be split into rectangular panes, each of
     which is a separate pseudo terminal (the pty(4) manual page documents the technical details of pseudo termi‐
     nals).  Any number of tmux instances may connect to the same session, and any number of windows may be present
     in the same session.  Once all sessions are killed, tmux exits.


session: 会话,一个服务器可以包含多个session
window: 窗口,一个session可以包含多个window
pane: 面板,一个window可以包含多个pane

tmux 配置:
tmux默认的bind-key是ctrl + b,可以修改为习惯的ctrl+a:
set -g prefix ^a
unbind ^b
bind a send-prefix

设置之后,ctrl+a+a可以在terminal中将光标一到行首


 

热点排行