17

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.

25

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

  • 2
    this is what actually worked for me (using putty) – Robin Manoli Sep 11 '14 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 '14 at 19:50
  • 4
    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 – ecerulm 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. – JosephMCasey Aug 7 '15 at 18:55
  • @JosephMCasey for ssh you could close ssh connection. – Pablo Bianchi Oct 20 '17 at 5:43
21

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

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

  • 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 '14 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 '14 at 9:08
4

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)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.