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.

1

4 Answers 4

31

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

5
  • 2
    this is what actually worked for me (using putty) Sep 11, 2014 at 7:47
  • 2
    If you see a prompt, 1 for screen mode, 2 for emacs mode, pick 1, then run this.
    – user34112
    Dec 21, 2014 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 Mar 20, 2015 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. Aug 7, 2015 at 18:55
  • @JosephMCasey for ssh you could close ssh connection.
    – Pablo A
    Oct 20, 2017 at 5: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.

3
  • 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 7, 2014 at 8: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, 2014 at 9: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, 2023 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.

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)

1
  • In your question you say Byobu in general, what if using Tmux instead of Screen?
    – Pablo A
    Jun 19, 2017 at 17:56

You must log in to answer this question.

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