From the Canyon Edge -- :-Dustin

Monday, December 26, 2011

Byobu 5 Released!


Happy Holidays everyone!  And for you, I have a gift -- Byobu 5.0!

I've been working hard over the last few months pulling together some big changes in the 4.x series, culminating in yesterday's release.  I gave an early preview during a lightning talk (31:02 mark) at the Ubuntu Developer Summit in Orlando, Florida a couple of months ago.

History

The Byobu project started a little over 3 years ago as a set of best practices and configuration profiles for GNU Screen with the screen-profiles package.  Byobu builds on top of existing text-based window managers and adds real-time dynamic status reporting, helper configuration utilities, and convenient keybindings.

Earlier this year, we started to reach the limits of what we could do with GNU Screen within Byobu.  The GNU Screen project hasn't been officially released in over 3 years, and Ubuntu is currently carrying nearly 20,000 lines in 48 patches to the upstream source.   I started looking into alternatives and learned a bit about Tmux, a newly redesigned and actively maintained window manager springing from the OpenBSD project.  The code is modern and elegant, and has an excellent programmable interface.  In June, I polled some Byobu users, asking of their interest in Tmux and the response was overwhelming!  I started porting Byobu to Tmux almost immediately.

New in 5.0

The most significant change that Byobu 5.0 introduces is a shift from GNU Screen to Tmux as the default backend.  You can still run Byobu in Screen-mode, but the default experience now uses Tmux.

Selecting your Back end

You can select your default back end using:

$ byobu-select-backend 

Select the byobu backend:
  1. tmux
  2. screen

Choose 1-2 [1]: 

After which, just running byobu will use your selected back end.  Alternatively, you can run byobu-screen or byobu-tmux at any time, to launch Byobu with a particular back end.

The New Byobu Look

When you start Byobu 5.0, you may notice a couple of immediate changes.  For starters, there's only one line of status at the bottom.  Your windows and status items are all in the same line.  You can set multiple status combinations in your ~/.byobu/status line, and cycle through them using Shift-F5.  Personally, I run Byobu maximized and use horizontal and vertical splits for efficiency (more on that in a minute!).


Tmux offers several advantages in the status line, namely: UTF8 characters and 256 colors.  If you look at the lower left of the screen shot, you should see the Ubuntu brandmark, u, as well as other nice symbols in the status bar, such as "▴2.0Mb ▾53kb".  Also, with 256 colors, we can get much closer to the right aubergine and orange.

The Help Menu

You can bring up Byobu's new help menu any time by pressing Shift-F1, with which you can find a comprehensive list of Byobu's keybindings.


Creating Windows, Splits, and Sessions

All of the "creation" actions are conveniently found under the F2 key.

  • Create new windows with F2
  • Create new horizontal splits with Shift-F2
  • Create new vertical splits with Ctrl-F2
  • Create new sessions with Ctrl-Shift-F2


Navigating Windows, Splits, and Sessions

As in previous versions, you can use F3 and F4 to move right and left among windows.

But far more intuitively, you can also use the up/down/left/right arrow keys with the alt/ctrl/shift modifiers.

  • Move between windows with Ctrl-Shift-Left and Ctrl-Shift-Right
  • Move between sessions with Alt-Up and Alt-Down
  • Move focus among splits with Shift-Up, Shift-Down, Shift-Left, and Shift-Right
    • Note that the split with the focus will be highlighted in purple
  • Re-size a split using Ctrl-Up, Ctrl-Down, Ctrl-Left, and Ctrl-Right
You can also:
  • Move a split using Ctrl-F3 and Ctrl-F4
  • Move a window using Ctrl-Shift-F3 and Ctrl-Shift-F4
The Status Bar

As usual, the F5 key deals with your status line.

  • Refresh all status and reload your profile with F5
  • Toggle through multiple status configurations with Shift-F5
  • Reconnect ssh, gpg, dbus, and X sessions with Ctrl-F5
    • sometimes, these connections become stale on session disconnect/reconnect
  • Randomly select the background color of the status line with Ctrl-Shift-F5
    • visually identify each system by its unique color
Disconnecting and Reconnecting Sessions

The F6 key handles disconnecting and detaching.
  • Detach the current session and logout with F6
  • Detach the current session, but do not logout with Shift-F6
  • Kill the current split with Ctrl-F6
Running byobu will automatically prompt you to select a session, if there are more than one running.  Or running byobu-select-session will also list the available sessions and prompt for selection.

$ byobu-select-session 

Byobu sessions...

  1. tmux: 0: 8 windows (created Sun Dec 25 09:59:05 2011) [170x42]
  2. tmux: 1: 1 windows (created Sun Dec 25 10:00:46 2011) [170x42]
  3. tmux: 3: 2 windows (created Sun Dec 25 12:30:55 2011) [136x36]
  4. Create a new Byobu session (tmux)
  5. Run a shell without Byobu (/bin/bash)

Choose 1-5 [1]: 

Scroll back and History

Each window and each split has an independent history buffer that can be scrolled and even searched, as usual with F7.

  • Enter scroll back with F7
  • Enter and navigate scroll back with Alt-PageUp and Alt-PageDown
  • Exit scroll back with Enter
  • Search scroll back with / and ? and then typing your search term
Window and Split Arrangement

As in previous versions, you can change a window's name with F8, but F8 also provides some advanced features around split arrangements.
  • Rename a window with F8
  • Cycle through preset split arrangements with Shift-F8
  • Restart a saved split layout with Ctrl-F8
  • Save the current split layout with Ctrl-Shift-F8
Configuration Window

As always, you launch the Byobu configuration menu with F9.  It's greatly simplified from previous versions.  (I'm actually hoping to deprecate it entirely one day, as the dependency on python-newt here has always been a little inconvenient from an upstream perspective.  I'm trying to make most of the features usable from key bindings.  Getting there eventually...)



Full Screen, Joining, and Breaking Out Splits

The F11 key is probably used by your X window manager to toggle a window from full screen and back.  Byobu uses Alt, Shift, and Ctrl and F11 to provide a few other features.

  • Break the current split out into a full window of its own with Alt-F11
  • Join the current window into a horizontal split with Shift-F11
  • Join the current window into a vertical split with Ctrl-F11
Escapes, Toggling Key bindings, and Piet Mondrian

The default escape sequence in Tmux is actually Ctrl-B.  To maintain consistency with Byobu and Screen, Byobu changes this back to Ctrl-A.  Byobu also loads a set of key bindings that operate Tmux with the same commands that are familiar to Screen users.
  • The F12 key is actually an alias for the escape sequence
  • Toggle on and off Byobu's key bindings with Shift-F12
    • this is useful when running programs that conflict with Byobu's keys, such as mc
  • For Piet Mondrian inspired fun, press Ctrl-Shift-F12




And with that, I'll leave you for now.  Give Byobu 5.0 a shot and let me know what you think.  Cheers everyone!  Hope you're having a wonderful holiday!

:-Dustin

12 comments:

  1. No oneiric of version 5 in the PPA?

    Something I would love is an extension to Gnome-Terminal such that if you are using Byobu then the Byobu "tabs" show up as gnome-terminal tabs. Similarly scrollback would just work.

    If done right you should be able to use byobu from gnome-terminal and never need to know or use any of the magic keystrokes or configuration. This would also help the people who are lighter weight users be able to get work done without having to learn some arbitrary new keys or configuration.

    ReplyDelete
  2. Thank you for an excellent piece of software that I use every day without even thinking about it!

    ReplyDelete
  3. Excellent !

    Thank you for the switch to byobu

    ReplyDelete
  4. Just wanted to let you know that there are a small handful of tools I use day in and day out. Byobu is up there with bash, vim, LaTex and gcc. All told, I expect you and the authors of screen have added several months to my effective working life, and I really appreciate that.

    Best,

    Barry Rountree
    Center for Applied Scientific Computing
    Lawrence Livermore National Laboratory

    ReplyDelete
  5. Excellent! I love byobu and use it every day. Switching to tmux as opposed to screen makes byobu even more of a pleasure to use!

    Keep up the GREAT work :)

    ReplyDelete
  6. I am running Putty on a windows 7 workstation and logging into an Ubuntu 11.10 server. I am experiencing key-binding issues at ATL-F2 CTL-F2 etc are not working. Any clues on how to diagnose the problem.

    ReplyDelete
  7. I just wanted to tell you how much I appreciate this fantastic little program. Every time I look at it (which is at least 20-30x per day), I wish I had come up with it myself.

    To mirror one of the comments above, this program has easily added months to my effective working life.

    Your documentation is excellent as well.

    Thank you for creating this and making it available.

    ReplyDelete
  8. I landed here looking for help with a byobu issue, but I read your request not to post here, so I'll simply say it's bug #945069, question #199015, and above all, thanks for your continued efforts producing such an excellent piece of software. Byobu makes terminal multi-plexing a breeze, and it's one of the first things I install on any new server.

    ReplyDelete
  9. How to break the indicators in Ubuntu 12.04:

    1. Open one byobu window.
    2. Change to another virtual desktop (to the right for example).
    3. Open another byobu window.
    4. ???
    5. Profit!

    ReplyDelete
  10. Thank you for this wonderful piece of software, I use it happily everyday! It has really become a vital part of my workflow.

    Thank you, thank you, thank you!

    ReplyDelete
  11. I have been using Byobu_5.17 and all of a sudden it will not launch. The terminal window will open and immediately close. I have reinstalled with the same problem. I am using Ubuntu 12.04; desktop: Unity and KDE.

    ReplyDelete

Please do not use blog comments for support requests! Blog comments do not scale well to this effect.

Instead, please use Launchpad for Bugs and StackExchange for Questions.
* bugs.launchpad.net
* stackexchange.com

Thanks,
:-Dustin

Printfriendly