22

One of the windows within my byobu session mysteriously stops receiving keystrokes. I can open new windows, but that particular window just hangs.

So now, every time I invoked byobu, I see 3 windows: 2 that I'm actually using, plus that 1 window that just sits there.

Is there a way to kill that wayward window? Preferably, just that one window. But if I need to clear the whole session, is also alright.

pepoluan
  • 1,271
  • 2
  • 12
  • 27
  • 3
    Possible duplicate of [How to close window at byobu?](https://superuser.com/questions/712410/how-to-close-window-at-byobu) – Pablo A Jun 19 '17 at 17:53

4 Answers4

30

Ctrl-a + k kills the currently focused window after a y/n confirmation in screen/byobu.

Kevin Panko
  • 7,346
  • 22
  • 44
  • 53
Forecaster
  • 401
  • 4
  • 2
  • 2
    this is what actually worked for me (using putty) – Robin Manoli Sep 11 '14 at 07:47
  • 2
    If you see a prompt, 1 for screen mode, 2 for emacs mode, pick 1, then run this. – user34112 Dec 21 '14 at 19:50
  • 5
    If you are using byobu in Emacs mode, meaning that Ctrl-a is mapped to "start of the line" you can use F12+k instead. F12 always works as the tmux/screen escape – RubenLaguna Mar 20 '15 at 12:17
  • 1
    Thanks, I using an SSH connection into a remote AWS ubuntu box, and this worked for me. Using the command the other commands detached the session without closing the window. – Joseph Casey Aug 07 '15 at 18:55
  • @JosephMCasey for ssh you could [close ssh connection](https://unix.stackexchange.com/a/13998/209677). – Pablo A Oct 20 '17 at 05:43
23

You can use Byobu's hotkey, Ctrl-F6 to force-kill windows or panes.

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

Dustin Kirkland
  • 8,411
  • 3
  • 24
  • 23
  • I tried that, but what happened was PuTTY closing the session. When I reopen a session, entering byobu still shows the 'hung' window? – pepoluan Feb 07 '14 at 08:53
  • 3
    Okay, I've reconfigured PuTTY to ignore keyboard shortcuts. `Ctrl+F6` still does not force-kill a window; it just detaches the session. – pepoluan Feb 19 '14 at 09:08
  • On a Mac, this just closes the entire byobu session. Going back in, I still have all the same windows. – Mr Mikkél Jan 24 '23 at 17:40
6

If you are using byobu in Emacs mode, meaning that Ctrl-a is mapped to "start of the line" you can use F12+k instead. F12 always works as the tmux/screen escape.

You will be prompted with a yes/no option from there.

Joseph Casey
  • 161
  • 1
  • 3
0

Finally, I resorted to this helpful answer on StackOverflow, i.e.:

screen -ls | grep "Detached" | awk '{print $1}' | xargs -i screen -X -S {} quit

(Of course, I did it manually, screen -ls followed by screen -X -S $screen_session quit)

pepoluan
  • 1,271
  • 2
  • 12
  • 27