Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 91feaaa9f9b3b1183543dba547d7643bf2526cbc
parent 33a637bd2a3dc8cd3b3bcf6c402681e3a3a8bad0
Author: Ross Mohn <rpmohn@waxandwane.org>
Date:   Tue, 23 Jun 2015 13:04:16 +0200

Fix strange behavior with abduco -A

Here are the steps:

1) Run 'abduco -A foo ping suckless.org'

2) Press 'CTRL+\' to detach

3) Run 'abduco -A foo' to reattach

4) Press 'CTRL+\' and it flashes the screen but does not detach

5) Press 'CTRL+\' a second time and it detaches this time

Here's what the output looks like:

    $ abduco -A foo ping suckless.org
    abduco: foo: detached
    $ abduco -A foo
    abduco: foo: detached
    abduco: foo: detached

Also, oddly, I am only seeing this behavior on my Ubuntu Linux host, not
my AIX hosts.

abduco.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/abduco.c b/abduco.c @@ -633,9 +633,10 @@ int main(int argc, char *argv[]) { die("attach-session"); break; case 'A': - if (session_alive(server.session_name) && !attach_session(server.session_name, true)) - die("attach-session"); - if (!attach_session(server.session_name, !force)) { + if (session_alive(server.session_name)) { + if (!attach_session(server.session_name, true)) + die("attach-session"); + } else if (!attach_session(server.session_name, !force)) { force = false; action = 'c'; goto redo;