How to close window at byobu?

42

11

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.

nazar_art

Posted 2014-02-04T20:09:25.383

Reputation: 913

Answers

68

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.

Dustin Kirkland

Posted 2014-02-04T20:09:25.383

Reputation: 7 101

1This even works when you can't type exist because the tab is frozen. – Konrad Höffner – 2015-09-02T08:57:00.930

2@KonradHöffner exit. – pjvandehaar – 2015-09-12T18:31:32.013

2The 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 – 2016-09-23T09:36:32.680

2I 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 – 2017-02-06T19:12:32.743

23

ctrl + a, then k

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

Sharique Abdullah

Posted 2014-02-04T20:09:25.383

Reputation: 331

3On Byobu 5.17 (Ubuntu 12.04), with a frozen command prompt, this is the only answer that worked for me. – pjvandehaar – 2015-09-12T18:29:25.533

And this works on the TTY too, where shift commands don't. You saved my day ! – Moonchild – 2018-01-06T10:56:07.873

6

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

yjwong

Posted 2014-02-04T20:09:25.383

Reputation: 1 383

@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 – 2018-03-03T18:29:58.110

1What is there are jobs running and you want to kill them all? <kbd>Ctrl</kbd>-<kbd>F6</kbd> doesn't work for me. – lid – 2014-03-30T02:51:19.023

4

Type "exit" at the command prompt.

Xavier J

Posted 2014-02-04T20:09:25.383

Reputation: 640

I tried this one - this doesn't work. I have read about this at man pages but this didn't work. – nazar_art – 2014-02-04T20:17:43.500

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 – 2014-02-04T20:19:40.240

at Lubuntu 13.10 this doesn't work. – nazar_art – 2014-02-04T20:21:31.127

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

Posted 2014-02-04T20:09:25.383

Reputation: 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

Posted 2014-02-04T20:09:25.383

Reputation: 1 269

0

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.

Antonio Serrano

Posted 2014-02-04T20:09:25.383

Reputation: 101