59

I started to use byobu, and find the it really cool thing.

It has a lot of hot keys. But I couldn't find one of them, and I stuck with one tricky point.

With F2 - you create a new window, but how to close this window when you don't need it anymore?

Later I found cool analogy for new window creation - just divide window and - shift-F2

And you can revert it back - ctrl-F6.

8 Answers 8

90

You can either type exit, or use Byobu's keybinding for killing windows/panes, which is Ctrl-F6.

Full disclosure: I am the author and maintainer of Byobu.

4
  • 2
    This even works when you can't type exist because the tab is frozen. Sep 2, 2015 at 8:57
  • 2
    @KonradHöffner exit. Sep 12, 2015 at 18:31
  • 2
    The question actually asks for closing the whole window at once, not just panel by panel. And either exit, Ctrl+6 or Ctrl+D close panel by panel. Isn't there a way to close all panels from a window at once @dustin-kirkland ?
    – Akronix
    Sep 23, 2016 at 9:36
  • 5
    I found that the suggested shortcut, Ctrl-F6, doesn't work on Mac OS X (maybe because of some system keyboard shortcut). Anyways it works perfectly on Ubuntu.
    – gerlos
    Feb 6, 2017 at 19:12
36

ctrl + a, then k

If it asks for confirmation, type y and hit enter.

3
  • 3
    On Byobu 5.17 (Ubuntu 12.04), with a frozen command prompt, this is the only answer that worked for me. Sep 12, 2015 at 18:29
  • 1
    And this works on the TTY too, where shift commands don't. You saved my day !
    – Moonchild
    Jan 6, 2018 at 10:56
  • This is correct, and works in CentOS Linux release 7.9 Feb 24, 2022 at 21:42
10

If there are no more jobs running in the window, then you can use Ctrl+D to close it.

2
  • 1
    What is there are jobs running and you want to kill them all? <kbd>Ctrl</kbd>-<kbd>F6</kbd> doesn't work for me.
    – lid
    Mar 30, 2014 at 2:51
  • @lid you can ctrl+c, or from other terminal using kill, pkill or killall. Ctrl+D send the EOF character (AKA ^D, \04, 0x4), send the signal to end the input stream to tty.
    – Pablo A
    Mar 3, 2018 at 18:29
8

Open a new window pressing F2 (or Fn + F2 on Mac).

From that new window, list all the open windows in current session:

byobu list-windows

Now, kill the window you want to close (suppose it is window no. 3):

byobu kill-window -t 3

So, you just have to substitute the last number in the previous instruction by the window's number you want to close.

1
  • This worked for me!
    – xabush
    Dec 1, 2020 at 10:07
5

Type "exit" at the command prompt.

3
  • I tried this one - this doesn't work. I have read about this at man pages but this didn't work.
    – catch23
    Feb 4, 2014 at 20:17
  • When I use "exit" on my Ubuntu VMs with Byobu, it closes the current window and goes to the previous (assuming I have more than one). If I only have one, then it closes the entire SSH session.
    – Xavier J
    Feb 4, 2014 at 20:19
  • at Lubuntu 13.10 this doesn't work.
    – catch23
    Feb 4, 2014 at 20:21
3

In my view, if you are using screen correct method is to use by pressing

Ctrl + a d

ie, press Ctrl + a then d then type

exit

So when you type byobu you can resume the session. For more details refer.

How do I get out of a screen without typing 'exit'?

3

There is no direct command for closing a window in Byobu if it has many splits in it. However there is a nice workaround. Press Shift+F9. This will pull up a prompt for sending the command to all splits of the current window. Now just type exit and huzzah!!

This will however not work if one of the splits has something running in it. In that case, manually close such splits by pressing Ctrl+F6 several times.

1

ctrl+a, then & is better than ctrl+a, then k as it will also display the name of the window you are about to kill ==> good as a confirmation.

E.g: (hotkeys run from the same split within window "covid19")

ctrl+a, then k outputs: Confirm 'kill-window'? (y/n)

ctrl+a, then & outputs: kill-window covid19? (y/n)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .