(1)clone 源代码仓库:

$ git clone https://github.com/tmux/tmux.git

(2) 编译之前先安装libevent,去官网下载tar包:
http://libevent.org

选择需要下载的版本复制链接地址,使用wget下载到本地(图形化的也可以直接下载),如(选择合适的版本,一般选stable即可):

    wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
    tar -xzf  libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable/
$ ./configure && make
$ sudo make install

(3) 编译tmux:

    cd tmux/
sh autogen.sh
./configure && make

安装编译过程可能会提示一些错误:

1)aclocal command not found
原因:自动编译工具未安装,安装上即可:

centOS: yum install automake
  1. configure: error: "curses or ncurses not found"
ubuntu:apt-get install libncurses5-dev
centos: yum install ncurses-devel

(4) 编译成功之后会在tmux下生成一个可执行程序:tmux

    ./tmux

执行的时候可能会出现找不到库的情况:

./tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

把安装好的libevent库的路径使用软链接到对应的目录:

    64位:
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
32位:
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5

(5)设置环境变量

  export PATH=xxx

(6)常用的tmux配置:

[root@c936a812-4ccb-491f-8eee-1dd4f670494b ~]# cat .tmux.conf
set -g prefix C-x
unbind C-b
setw -g mode-keys vi
#允许用鼠标切换窗口/调节分屏大小
setw -g mouse-resize-pane on
setw -g mouse-select-pane on
setw -g mouse-select-window on
setw -g mode-mouse on set-option -g history-limit 5000 bind -t vi-copy 'v' begin-selection # Begin selection in copy mode.
bind -t vi-copy 'C-v' rectangle-toggle # Begin selection in copy mode.
bind -t vi-copy 'y' copy-selection # Yank selection in copy mode. bind Left swap-window -t -1
bind Right swap-window -t +1 bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}" bind k selectp -U
bind j selectp -D
bind h selectp -L
bind l selectp -R bind ^k resizep -U 10
bind ^j resizep -D 10
bind ^h resizep -L 10
bind ^l resizep -R 10 bind ^u swapp -U
bind ^d swapp -D bind ^a last
bind ^q killp set-window-option -g window-status-current-bg yellow
set-window-option -g window-status-current-fg black # Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum' # Plugin configure
set -g @continuum-restore 'on' run '~/.tmux/plugins/tpm/tpm'
You have new mail in /var/spool/mail/root

其中需要用到插件管理,需要先安装插件管理器:

$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

源码编译tmux的更多相关文章

  1. debian下如何源码安装tmux

    一.源码安装ncurses库 1.1 获取源码 wget https://invisible-island.net/datafiles/release/ncurses.tar.gz tar xvf n ...

  2. Android 5.0源码编译问题

    如果是自己通过repo和git直接从google官网上download的源码,请忽略这个问题,但是由于google在国内被限制登录,通过这一种方法不是每个人都能download下来源码,通常的做法就是 ...

  3. Android stdio Apktool源码编译

    Android Apktool源码编译 标签(空格分隔): Android Apktool 源码编译 需求 习惯NetBeans调试smali需要用Apktool反编译apk,需要用-d的参数才能生成 ...

  4. SSH/SSL 源码编译安装简易操作说明

    环境:CentOS 6.7 安全加固需求,由于某盟扫描系统主机有SSL系列漏洞,客户要求必须修复: 解决方案:将SSH/SSL升级到最新版本,删除SSL旧版本(实测不删除旧版本某盟扫描无法通过). 当 ...

  5. Hadoop源码编译过程

    一.           为什么要编译Hadoop源码 Hadoop是使用Java语言开发的,但是有一些需求和操作并不适合使用java,所以就引入了本地库(Native Libraries)的概念,通 ...

  6. World Wind .NET源码编译问题处理

    World  Wind  .NET源码编译问题处理 下载了World_Wind_1.4.0_Source源码(http://worldwindcentral.com/wiki/NASA_World_W ...

  7. 源码编译安装 MySQL 5.5.x 实践

    1.安装cmakeMySQL从5.5版本开始,通过./configure进行编译配置方式已经被取消,取而代之的是cmake工具.因此,我们首先要在系统中源码编译安装cmake工具. # wget ht ...

  8. Linux 安装node.js ---- 源码编译的方式

    一 : 普通用户: 安装前准备环境: 1.检查Linux 版本 命令: cat /etc/redhat-release 2.检查 gcc.gcc-c++ 是否安装过 命令: rpm -q gcc rp ...

  9. 烂泥:mysql5.5数据库cmake源码编译安装

    本文由秀依林枫提供友情赞助,首发于烂泥行天下. 以前也写过一篇有关mysql5.0源码编译的文章,该文章为<烂泥:mysql5.0数据库源码编译安装>.但是MySQL自5.5版本以后,就开 ...

随机推荐

  1. linux 登录数据库

    -h   地址 (例如:127.0.0.1,localhost) mysql -h 127.0.0.1 -u root -p

  2. JavScript 日期格式化

    JavScript 日期格式化 //日期格式化 function formatDate(date,fmt) { if(date == null || typeof (date) == undefine ...

  3. 快用Visual Studio(一)- 打开文件

    在命令行中使用Visual Studio code打开文件: 打开Visual Studio code: CMD + SHIFT + P打开控制面板: 键入"shell command&qu ...

  4. 【前端】强大的javascript原生选择器querySelector 和 querySelectorAll

    querySelector 和 querySelectorAll 在传统的 JavaScript 开发中,查找 DOM 往往是开发人员遇到的第一个头疼的问题,原生的 JavaScript 所提供的 D ...

  5. Hibernate的懒加载session丢失解决方法

    在web.xml加入spring提供的过滤器,延长session的生命周期 <!--Hibernate的懒加载session丢失解决方法 --> <filter> <fi ...

  6. brpc编译运行

    自百度开源brpc后就一直在关注,看了下brpc都源码,感觉大牛写的果然不一样,由于之前我做c++游戏服务器开发,所以主要看了下网络底层代码,收益颇多,果然一天不学习就要落伍. 现在主要和大家说下我编 ...

  7. 【卷积神经网络】对BN层的解释

    前言 Batch Normalization是由google提出的一种训练优化方法.参考论文:Batch Normalization Accelerating Deep Network Trainin ...

  8. 在centos7上安装部署hadoop2.7.3和spark2.0.0

    一.安装装备 下载安装包: vmware workstations pro 12 三台centos7.1 mini 虚拟机 网络配置NAT网络如下: 二.创建hadoop用户和hadoop用户组 1. ...

  9. MySQL表类型MyISAM/InnoDB的区别(解决事务不回滚的问题)

    MyISAM:这个是默认类型,它是基于传统的ISAM类型,ISAM是Indexed Sequential Access Method (有索引的顺序访问方法) 的缩写,它是存储记录和文件的标准方法.与 ...

  10. Poi中getPhysicalNumberOfCells 与 getLastCellNum的差异

    getPhysicalNumberOfCells 与 getLastCellNum的区别 用org.apache.poi的包做excel导入,无意间发明若是excel文件中有空列,空列后面的数据全部读 ...