63

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.

catch32
  • 1,193

8 Answers8

95

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.

39

ctrl + a, then k

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

10

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

Pablo A
  • 1,733
9

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.

5

Type "exit" at the command prompt.

Xavier J
  • 660
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'?

Ajeeb.K.P
  • 131
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.

shivams
  • 1,804
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)

StefTN
  • 141