V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chuhades
V2EX  ›  tmux

tmux 很赞啊!

  •  
  •   chuhades · 2013-06-22 19:38:23 +08:00 · 10094 次点击
    这是一个创建于 3962 天前的主题,其中的信息可能已经有所发展或是发生改变。
    49 条回复    1970-01-01 08:00:00 +08:00
    Ultratude
        1
    Ultratude  
       2013-06-22 19:43:32 +08:00
    用了挺久了。
    TankyWoo
        2
    TankyWoo  
       2013-06-22 19:47:17 +08:00
    昨晚刚写了一篇介绍tmux的博客 http://www.wutianqi.com/?p=3676
    bigredapple
        3
    bigredapple  
       2013-06-22 19:52:40 +08:00
    用了很久了
    Sunyanzi
        4
    Sunyanzi  
       2013-06-22 19:58:48 +08:00   ❤️ 1
    说句可能引人反感的话 ... 反正我觉得吧 ...

    没用过 screen / tmux 的 Linux 用户事实上不算是一个真正的 Linux 使用者 ...
    chuhades
        5
    chuhades  
    OP
       2013-06-22 19:58:50 +08:00   ❤️ 1
    @TankyWoo 给力!

    @Ultratude @bigredapple 看来我又out 了...
    chuhades
        6
    chuhades  
    OP
       2013-06-22 19:59:47 +08:00
    @Sunyanzi 好吧,那我也就算半个..
    之前有看过,没深入接触..
    kfll
        7
    kfll  
       2013-06-22 20:08:54 +08:00
    用了两个月,放弃了
    gno23x
        8
    gno23x  
       2013-06-22 20:11:40 +08:00
    @Sunyanzi 被排外了,好伤心。
    pubby
        9
    pubby  
       2013-06-22 20:39:37 +08:00
    一直用screen
    只是默认的最大40个window实在是太少了
    likuku
        10
    likuku  
       2013-06-22 20:47:22 +08:00
    用screen好几年,习惯它了,试用过tmux,觉得别扭就懒得换。
    kevinv
        11
    kevinv  
       2013-06-22 22:20:04 +08:00
    @Sunyanzi 呵呵,个人习惯问题~
    love
        12
    love  
       2013-06-22 22:40:44 +08:00
    只用screen的防断线功能,至于别的功能实在懒得去学了平时也用不到,什么多窗口之类的万一需要再开个终端就是了。
    jmu
        13
    jmu  
       2013-06-22 23:06:07 +08:00
    @Sunyanzi 呵呵
    tywtyw2002
        14
    tywtyw2002  
       2013-06-22 23:11:06 +08:00
    ssh上面用screen比较多。不过scree也有一些毛病呀。
    0bit
        15
    0bit  
       2013-06-23 08:33:20 +08:00
    tmux配合zsh加上oh-my-zsh,才是神器
    yakczh
        16
    yakczh  
       2013-06-23 08:47:05 +08:00
    复制字符的时候有问题,把横线也复制了
    582033
        17
    582033  
       2013-06-23 09:19:47 +08:00
    @Sunyanzi byobu算不算。。
    dulao5
        18
    dulao5  
       2013-06-23 09:32:34 +08:00
    screen 的有些会话有时候会不明原因的坏掉, 最近tmux没发现这个问题,用的很顺畅了。

    每天早上的工作环境,秒恢复。
    duhastmich
        19
    duhastmich  
       2013-06-23 09:41:00 +08:00
    tmux + vim + vimux 才是神器
    bcxx
        20
    bcxx  
       2013-06-23 09:54:56 +08:00
    @582033 byobu 的爸爸就是 tmux 啊
    sdpfoue
        21
    sdpfoue  
       2013-06-24 00:17:43 +08:00
    screen都装,tmux好多机器都没有还不能装。放弃了
    TankyWoo
        22
    TankyWoo  
       2013-06-24 07:31:26 +08:00
    @sdpfoue

    tmux在哪些机器上装不了?
    013231
        23
    013231  
       2013-06-24 07:46:52 +08:00
    @yakczh 你用的是Terminal的復制功能, 還是tmux的復制功能?
    yakczh
        24
    yakczh  
       2013-06-24 09:23:51 +08:00   ❤️ 1
    Terminal,就是鼠标拉一下
    zava
        25
    zava  
       2013-06-24 09:59:08 +08:00
    tmux 最大的问题在于一般发行版都没有默认装。
    sdpfoue
        26
    sdpfoue  
       2013-06-24 10:05:30 +08:00
    @TankyWoo 哪些都能装,问题是你得有权限
    TankyWoo
        27
    TankyWoo  
       2013-06-24 10:27:05 +08:00
    @sdpfoue 哦,我以为你是说有的发行版安装有问题

    一般个人系统用这些无所谓,想必这个权限肯定是有的

    线上系统一般还是用screen就足够了
    raptor
        28
    raptor  
       2013-06-24 10:41:46 +08:00
    @likuku 可以配置成跟screen一样的热键。我现在是screen/tmux/byobu都在用……
    013231
        29
    013231  
       2013-06-24 10:47:35 +08:00
    @yakczh 應該用tmux本身的復制功能. tmux中的分隔線本身就是字符, 在Terminal中復制時自然會被復制下來.
    hit9
        30
    hit9  
       2013-06-24 11:18:53 +08:00
    相当赞!
    SAGAN
        31
    SAGAN  
       2013-06-24 11:41:48 +08:00
    我当初开始用tmux是因为嫌Ubuntu自带的切换terminal窗口快捷键太难按(Ctrl+PageUp/PageDown) - -
    oklqh
        32
    oklqh  
       2013-06-24 14:27:24 +08:00
    @TankyWoo 文章不错,建议重新排下版,看起来密密麻麻。
    TankyWoo
        33
    TankyWoo  
       2013-06-24 16:48:20 +08:00
    @oklqh 嗯,文字间距没设置好,我抽个时间再改改css
    terry
        34
    terry  
       2013-06-25 07:26:47 +08:00
    tmux + teamocil 很赞,*NIX 用户必须会用, tmux / screen 否则只能停留在初级阶段。
    happlebao
        35
    happlebao  
       2013-06-25 07:36:57 +08:00
    和awesome windows manager这种有什么区别?
    terry
        36
    terry  
       2013-06-25 08:26:43 +08:00
    @happlebao 和 WM / DE 没有关系,自己试一下就知道是什么了。
    gnepnaur
        37
    gnepnaur  
       2013-06-25 09:37:54 +08:00
    最近发现screen用的时候有些问题,之后发现了tmux,觉得很不错~
    for4
        38
    for4  
       2013-06-25 09:47:35 +08:00
    tmux在debian 7上分屏显示好像有点问题
    palxex
        39
    palxex  
       2013-06-28 02:51:57 +08:00
    tmux如果能连到ttl serial上估计就真能替换screen了。
    missdeer
        40
    missdeer  
       2013-06-28 08:46:23 +08:00
    发现byobu-tmux比tmux更好用点,不过openSUSE官方仓库里貌似没有。。。还好我主要是在CentOS上用。。。
    firsthym
        41
    firsthym  
       2013-06-28 09:09:58 +08:00
    不错的分享
    openroc
        42
    openroc  
       2013-06-28 09:32:11 +08:00
    贴个配置文件,版本大于1.7

    #!/usr/local/bin/tmux
    # vim: syntax=tmux

    # rebind bind key (screen)
    #set -g prefix C-a
    #bind C-a last-window

    #
    bind C-b last-window
    bind C-z run-shell '/usr/local/bin/tmux-zoom.sh'

    # reload config
    bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."

    # troggle statusbar
    bind q set status

    # display time
    set -g display-time 2500

    set -g history-limit 65535

    # Look good
    #set -g default-terminal "screen-256color"

    # Start tab numbering at 1
    set -g base-index 1

    # Enable mouse support
    setw -g mode-mouse off
    set -g mouse-select-pane on
    set -g mouse-resize-pane on
    set -g mouse-select-window on

    # enable resize for attaching via different resolution display
    setw -g aggressive-resize on

    # enable monitor
    setw -g monitor-activity on
    set -g visual-activity on

    # Act like Vim
    setw -g mode-keys vi
    bind h select-pane -L
    bind j select-pane -D
    bind k select-pane -U
    bind l select-pane -R

    # use different keys to split vertical and horizonal
    bind | split-window -h
    bind - split-window -v

    bind -n M-v split-window -h
    bind -n M-s split-window -v

    #--Status-Bar-------------------------------------------------------------------
    # status bar
    set -g status-utf8 on

    # Default colors
    set -g status-bg black
    set -g status-fg white

    ## Left side of status bar : Show session-name and host-name
    set -g status-left-length 20
    set -g status-left '#[fg=green][#[bg=black,fg=cyan]#S#[fg=green]]'

    ## Middle of status bar, window labels
    #Inactive
    setw -g window-status-format '#[fg=cyan,dim]#I#[fg=blue]:#[default]#W#[fg=grey,dim]#F'
    # Current or active
    setw -g window-status-current-format '#[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=white]#W#[fg=dim]#F'
    # Alerted window in status bar. Windows which have an alert (bell, activity or content).
    setw -g window-status-bell-fg red
    setw -g window-status-bell-bg white

    ## Right side of status bar
    # show current window title, date and time in my choice of colors
    set -g status-right '#[fg=green][#[fg=white]#T#[fg=green]][#[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]#[fg=green]]'


    set -g status-position top
    tinytub
        43
    tinytub  
       2013-06-28 12:21:32 +08:00
    非专职开发人员表示,xshell这类的工具已经够用了...
    chaker
        44
    chaker  
       2013-06-28 12:44:05 +08:00
    @sdpfoue 装在自己的home里啊,-prefix=~/bin
    saharabear
        45
    saharabear  
       2013-07-06 01:30:57 +08:00
    @likuku 我也用screen习惯了,所谓的分屏功能,基本上用Emacs就替代了.目前连screen的多窗口也不用了,现在我居然搞成了screen+Emacs, screen单屏操作.
    venmos
        46
    venmos  
       2013-07-06 16:19:48 +08:00
    我的Tmux Configure => https://gist.github.com/venmos/5939219

    预览

    tioover
        47
    tioover  
       2013-07-07 00:14:55 +08:00
    用了半天,感觉还是没多大用,zsh + gnome 的虚拟终端就够了,tty 下倒是比较实用。
    tioover
        48
    tioover  
       2013-07-07 00:40:24 +08:00
    唔,求教 man看到调整分栏大小用的是 C-上下左右,但是每次只能调整一点

    M-Up, M-Down M-Left,M-Right
    Resize the current pane in steps of five cells.

    这里的M 是什么键

    另外楼上设置里面的 Enable mouse support ,放到配置里面以后鼠标还是没办法呀。
    013231
        49
    013231  
       2013-07-07 04:13:45 +08:00
    @tioover
    Ctrl keys may be prefixed with `C-' or `^', and Alt (meta) with `M-'. -- from man page

    順便說一下, 如果是OS X的Terminal, 需在Preferences -> Settings -> Keyboard裏勾上"Use option as meta key".
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5402 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 06:00 · PVG 14:00 · LAX 23:00 · JFK 02:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.