hub is a command-line wrapper for git.
It’s not immediately obvious how to install it from a fresh Ubuntu or Linux Mint install, so here goes.
» Read more: How to install hub for GitHub on Linux Mint and Ubuntuhub is a command-line wrapper for git.
It’s not immediately obvious how to install it from a fresh Ubuntu or Linux Mint install, so here goes.
» Read more: How to install hub for GitHub on Linux Mint and UbuntuIf you use Linux, and have multiple terminal windows open on your desktop, read on.
Thanks to Randall Degges who gave an introduction to tmux.
tmux is what’s called a terminal multiplexer.
tmux is a program you can run in your terminal. It allows you to have multiple terminal “windows” running in the one terminal window in your windows manager.
You can also split each terminal window into several panes.
This is useful if you find yourself opening multiple terminal windows.
I’m a tmux noob, so I still wasn’t sure where to start with tmux, so here’s how I got going.
When running tmux, press Ctrl+b (Linux). And then enter your tmux command.
For a list of commands, check man tmux.
I was confused by man tmux where it referred to C-b. It does explain that this means typing Ctrl+b followed by command you desire.
tmux. If the program is not installed, install it. On Debian-based systems you’ll be told how to install it with an apt-get command.man tmux tells us that the command " splits the current pane into two, top and bottom.
This means that you first press Ctrl+b, and immediately followed by typing ".
Great. You now have two terminal panes to work in.
From now on I’ll use the standardised C-b notation, which means typing Ctrl+b.
Type:
man tmux
Now you have the tmux man page in one pane, and your standard terminal in the other pane. You should be starting to see the usefulness of tmux.
You can’t just use your mouse to click into the pane you want to use.
An easy way to cycle between panes in your current window is:
C-b o
To kill the current pane:
C-b x
Then type y to confirm.
A task for you:
Read the man page to find out how to split a pane vertically rather than horizontally.
Split the window into two panes once again.
So far, we have been dealing with one tmux window, with multiple panes.
You can also have multiple windows, with multiple panes. I consider a window like a desktop, or a browser tab.
Create a second window:
C-b c
Check the bottom toolbar. You’ll see your two windows (0 and 1) listed.
Make it easier to identify windows by typing:
C-b ,
(Yes, that’s a comma.)
Now type a short name to identify this window.
No Alt-Tab here!
Press C-b and then the number of the window you want to open.
Try switching between window 1 and 0 and back again:
C-b 0
C-b 1
C-b 0
Type:
C-b n
Or cycle to the previous window:
C-b l
As the man page tells you, issue this command to quickly review the available keybindings:
Ctrl+b ?
How to scroll through the history of the current pane. I’m used to being able to scroll up with the mouse wheel. There must be another way to scroll, presumably with a keyboard shortcut.
Sessions: I know there is functionality to remember the layout of your windows and panes for the next time you run tmux.
Automatically launching tmux for each new terminal: once I get used to tmux, I guess I’ll want to have it launched automatically (?).
Randall mentions:
If you’ve ever had the need to run multiple terminal windows inside an existing terminal window, you’ve probably heard of GNU screen.
Unfortunately, I hadn’t.
Ok, to be more honest, I had read about screen one week before reading his blog post.
But I had been using Linux for three years before realising you could even split your terminal window.
Enjoy tmux. Was this quick run-down of help to you? What other commands have you found useful?
Bonus: I enjoyed writing this post in WordPress as Markdown syntax, thanks to the Markdown on Save Improved plugin, although the parser is not perfect.