2016年3月29日 星期二

tmux

tmux -2 a

tmux -2 ls


c-b = control + b

c-b " split the current pane into two top/bottom

c-b % split to left/right

c-b t show clock

c-b l last window

c-b n next window

c-b up/down/left/right move up down left right pane

c-b c-o rotate the pans in the current window backwards

c-b c create a new window

c-b d detach

3 則留言:

  1. https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

    tmux scrollback

    c-b [
    可以上下 page up, page down

    q 離開

    tmux 將 scrollback buffer寫到檔案

    For those looking for a simple answer, just use prefix + :, then type in capture-pane -S -3000 + return (Replace 3000 with however many lines you'd like to save.) This copies those lines into a buffer.

    Then, to save the buffer to a file, just use prefix + : again, and type in save-buffer filename.txt + return, replacing filename with whatever you'd like.

    (By default prefix is ctrl + b.)


    c-b :
    capture-pane -S -3000 (存300行)

    c-b :
    save-buffer ~/ccce.txt

    將 buffer存在 home目錄的 ccce.txt

    回覆刪除
  2. 開新的三格視窗並執行 dmesg, clock, top
    tmux new-session \; send-keys 'dmesg | tail' C-m \; split-window -v \; clock-mode \; split-window -h \; send-keys 'top' C-m \;

    回覆刪除
  3. https://pttdigit.com/linux/M.1536211463.A.C19.html

    tmux在開始就開多視窗並且有起始指令
    範例
    https://i.imgur.com/4IEMQOa.png


    對應的指令, new-session, send-keys, split-window
    tmux new-session \; \
    send-keys 'dmesg | tail' C-m \; \
    split-window -v \; clock-mode \; \
    split-window -h \; \
    send-keys 'top' C-m \;
    參考資料
    https://stackoverflow.com/questions/5609192/
    how-to-set-up-tmux-so-that-it-starts-up-with-specified-windows-opened
    https://tmuxcheatsheet.com/

    回覆刪除