In the afternoon, if I get sleepy working at my desktop, I switch to a laptop at a standing desk, or a coffee shop. Press ` d (for detach) to disconnect from tmux. Now press ` several times, until you find an arrangement you like. Press ` - (backtick then dash) twice, which should give you three panes vertical panes. Say you want to monitor three log files at once to track an error, or log files on three separate servers. Tail all the logsĪnother handy example of panes is monitoring log files. tmux and a browser, that’s all I ask for. Many people use Ctrl-a all the time (it’s the screen default), but I use the tmux prefix many times more often than a backtick.Ī nice side effect of living in tmux is that reate is how I get a new window - on remote servers, on OSX, in Gnome, KDE, etc. If you need a literal `, press ` Ctrl-a to switch the prefix to Ctrl-a. On my keyboard ` is next to the number key row, which is why I use it as the tmux prefix. Move between your windows with ` 1 or ` 2 etc. If you need a whole new window, instead of splitting the current one into panes, press ` c (for create). Scrollback in a pane is ` PgUp and you just hit Enter to exit scrollback mode. Once you’re done with a pane Ctrl-d closes it (Ctrl-d stops / closes most anything in Unix). Switch to the pane on the right, press ` then - for a horizontal split. Next, say you need to try something out in ipython. To move between panes, use ` then the arrow keys. Your screen should split vertically, and your cursor is in the new pane. Instead of opening a new terminal window and Alt-Tab-ing your way to distraction, hit ` then | (backtick then pipe). If on your keyboard backtick ` is not top left, next to 1, then you may want to change the set-option -g prefix line. Good key bindings make all the difference in tmux, and the defaults are finger breaking. nf in your home directory, and add these lines: set -g default-terminal "screen-256color" Improving your Unix skills is one of the best long term knowledge investments you can make.įirst install it - it’s in your Linux package manager and in OSX brew. Tools, libraries and programming languages all change, but Unix stays. In this post I hope to convince you to use it long enough to benefit.Īside from focus, the second thing tmux will give you is better Unix skills. At first it’s just screen with vertical splits. The challenge with learning tmux is that the benefits are not immediately apparent. On the surface tmux manages your terminal windows, but really it helps you stay focused.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |