zoukankan      html  css  js  c++  java
  • 源码编译tmux

    (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
  • 相关阅读:
    python对打印出中文乱码问题的解决方案
    git常用操作
    如何创建git开发环境
    对自然界的三种花进行分类
    创建第一个简单的AI分类器
    使用TensorFlow创建第变量定义和运行方式
    MySQL的left,substr,instr截取字符串函数使用实例
    构建之法阅读笔记05
    找水王2
    第十二周学习进度
  • 原文地址:https://www.cnblogs.com/kuang17/p/9836839.html
Copyright © 2011-2022 走看看