When I usually work with Linux, I have multiple terminals up and running.
I'm not particularly inconvenienced by that, but I was looking into the possibility of launching multiple shells in a single CUI terminal and switching between them in tabs like Chrome.
Then there was Byobu, an application just as I had imagined!
For more details, please refer to the above article, but here we have included a brief description of how to use the system with tabs and notes on how to use it with WSL.
What is Byobu?
Seeing is believing. For example, if you open four shells and switch between them with tabs, you will see the following. (The tabs are shown at the bottom)
It is possible to split the screen, but I just wanted to switch by tabs, so I will skip the explanation here.
The actual multiple shell processing is done by "tmux" or "GNU screen", and Byobu is a wrapper software to make it easier to use. By default, "tmux" is used.
install
It is standard in Ubuntu.
sudo apt-get byobu
launch
byobu
With the default settings, WSL will mess up the screen, so close the shell with "exit" once, exit Byobu, and go straight to the settings.
setting (of a computer or file, etc.)
When you start Byobu, a "\~/.byobu" folder will be created and a configuration file will be created in it.
display items
Set the status bar display items in "\~/.byobu/status".
- tmux_left" is the left side and "tmux_right" is the right side of the display items.
- If you put "#" in front of the item name, it will be commented out and will not be displayed.
In this case, I did not want to display anything, so I commented out everything.
In the case of WSL, the "LOGO" will cause screen clutter, so please be sure to comment it out.
\~/.byobu/status
tmux_left="#logo #distro #release #arch #session" tmux_right="#network #disk_io #custom #entropy #raid #reboot_required #updates_available #apport #services #mail #users #uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp #battery #wifi_quality #processes #load_average #cpu_count #cpu_freq #memory #swap #disk #whoami #hostname ip_address #time_utc #date #time"
Ctrl+a" key binding release
Byobu uses "Ctrl+a" as a key assignment by default, but it should be deactivated because it butts up against the shell assignment.
- Start Byobu
- Type "byobu-ctrl-a
- Select "2" to release
How to use Byobu
- Add tab: F2
- Tab switching: Alt+→,Alt+←
Exiting the shell with "exit" will also close the tabs. Closing all tabs will also close Byobu.
Unfortunately, with Byobu, it is no longer possible to scroll the screen with the mouse wheel.
To scroll the screen instead, press "F7" to enter the scroll mode and use the cursor up/down or PageUp/Down to scroll.
To return from scroll mode to normal mode, press "Enter".
Impressions, etc.
I knew about "screen" but not "Byobu". And it's in there by default...
Since it is a CUI application, it can be used even when accessed via SSH.
Since the only keys to remember are "F2," "F7," and "Alt+Left and Right Arrows," the psychological hurdle for introduction is also low.
I am thinking of using Byobu to display docker-compose logs in tabs, although I am unlikely to use it for my main work since I usually have multiple terminals up and running.