亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

screen to tmux: A Humble Quick-start Guide ?

系統(tǒng) 2388 0

screen to tmux: A Humble Quick-start Guide ? My Humble Corner

screen to tmux: A Humble Quick-start?Guide

An online friend named bmc_ on Twitter introduced me to tmux. It reportedly has simpler, cleaner code than screen, which implies that it’s more robust, in addition to more very useful features.

The problem is tmux is very different from screen. It wasn’t at all easy to jump straight into tmux, without doing a thorough read of the man pages, which is not exactly how great first impressions are made.

That’s why I decided to write this.

This quick-start guide will assume you are familiar with screen.

?

“Let the Wild Rumpus Begin”

Launch yourself into tmux:

                tmux
              

Ctrl+B is your tmux shortcut (just like Ctrl+A used to be in screen).

You’re looking at your first window, which has only one pane.?We’ll call this your first prompt.?Log into irc or something “persistent”.

Split your window horizontally to create a new pane:

                [Ctrl+b] "
              

You can now work in this second prompt while observing the first.

These shortcuts allows you to swap in Alt+Tab style:

                [Ctrl+b] {
[Ctrl+b] }
              

You can use these keys to move between panes:

                [Ctrl+b] [Up|Down|Left|Right]
              

Let’s say, though, that you want to open a third prompt in that bottom area, without losing your second. Creating a new window causes you to lose view of your first prompt, which has your persistent task like IRC. We could add a new pane by splitting the bottom pane vertically:

                [Ctrl+b] %
              

This splits valuable screen space, though, and you only want to be using one prompt in that bottom space at a time anyway.

Let’s try this. Create a new window:

                [Ctrl+b] c
              

This space is going to be a “holding” area for your second prompt until you’re done with your third. (We have to do this because of a difference in how panes are utilized. Screen looks at panes as permanent fixtures of your workspace until you say otherwise, whereas tmux looks at panes as specific to a prompt, unless said otherwise, and will close that pane when the prompt closes.)

For the curious, a list of open windows can be found here:

                [Ctrl+b] w
              

Type something into this new window so you can tell the difference between it and the others. Now go back to the first window:

                [Ctrl+b] 0
              

Focus the bottom pane using the Up/Down keys mentioned previously, and then type this:

[Ctrl+b] :swapp -s 1.0 # means “swap prompt in window #1 pane #0 with the current prompt”

With any luck that bottom pane now contains your third prompt, and the second prompt will be in the new window.

Copying Window History

By default, tmux keeps 2000 lines of “window history”. This is what screen calls scrollback.

You can enter copy mode and view this history by typing:

                [Ctrl+b] PageUp
              

The “q” key quits this mode.

If you want to take advantage of copy mode, use Space to mark the first character of your selection, and Enter to mark the end. To paste, use the following shortcut:

                [Ctrl+b] =
              

This shortcut will also bring up a list of paste buffers if there is more than one.

More Pane Management

(No pun intended.)

You can also “break” a pane out of its current window into an entirely new window:

                [Ctrl+b] !
              

You can also do the reverse, and “join” an existing pane from another window into the current window:

                [Ctrl+b] :joinp -h -s 0.0 -p 75 # join window #0 pane #0 horizontally, giving it 75% of the screen space
              

If you decide you don’t like the size of a pane, you can use the following shortcuts to resize the current pane:

                [Ctrl+b] Alt+[Up|Down|Left|Right]
              

Interestingly enough, any shortcut involving directional keys can be used over and over rapidly. As soon as there are any pauses, however, tmux stops listening and you’ll have to re-execute the shortcut again.

Window and pane numbers can be looked up as follows:

                [Ctrl+b] w # for window numbers
[Ctrl+b] q # for pane numbers
              

Built-in Help

You can find a list of keybindings here:

                [Ctrl+b] ?
              

Use the “q” key to get out of this and other interactive modes.

Leaving and Coming Back Again

Exiting a window means either causing all prompts to close (via “exit” in each for example) or moving panes within a window to other windows (via “joinp” for example) until a window has no more panes. At either point, the window closes.

If your window is misbehaving, you can “kill” it by typing:

                [Ctrl+b] &
              

Similarly, tmux will close when there are no more windows in a session.

If you want to leave your windows intact but close the terminal or ssh connection, you can detach and reattach later. Detaching works just like screen:

                [Ctrl+b] d
              

Last, but not least, you can reattach to the existing session as follows:

                tmux a
              

Feedback Welcome

This gets you started. The man page is well written, but very long. If you think I missed something important, or need help with a particular use of tmux, comment below.

  • Updated 2011/08/30 12:20 EDT – Added a bit of text on window history, and added more sections to break this page up a bit better.
  • Updated 2011/08/31 14:42 EDT – Added more about closing windows and sessions, thanks to David in comments .

screen to tmux: A Humble Quick-start Guide ? My Humble Corner


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美成人午夜视频在线观看 | 9久re热视频这里只有精品 | 日韩经典欧美精品一区 | 亚洲欧美在线综合一区二区三区 | 久久经典免费视频 | 日本欧美黄色 | 久久精品视频播放 | 日本一级特黄大一片免 | 深夜福利网站在线观看 | 99国产精品一区二区 | 国语一区 | 奇米777狠狠| 1000部羞羞禁止免费观看视频 | 久久99国产精品 | 日日草夜夜操 | 精品a视频 | 高清二区 | 亚洲大片在线观看 | 久久这里| 亚洲国产精品区 | 亚洲图欧美日韩色综合图 | 日本中文字幕视频在线看 | 91精品国产91久久久久福利 | 久久啊| 婷婷色婷婷 | 羞羞的视频在线观看 | 91精品免费久久久久久久久 | 日日夜夜精品 | 亚洲字幕 | 国产伦精品一区二区三区在线观看 | 国产激情一区二区三区 | 久久乐国产精品亚洲综合m3u8 | 欧美一级人与动毛片免费播放 | 久久福利资源国产精品999 | 国产高清国产专区国产精品 | 亚洲精品国产一区二区三区在 | 欧美一a一片一级一片 | 国产在线综合网 | 国产美女久久精品香蕉69 | 久草精品视频在线观看 | 免费又爽又黄禁片视频在线播放 |