martanne/abduco

Detatching/killing a session from the command line

jtamagnan opened this issue Β· 10 comments

I don't if this would be possible but it would be very neat to have a way to detach a session from the command line instead of by using key.

Similarly it would be very useful to kill a session from the command line.

Could you describe your use case a bit? What would you like to achieve?

The problem with detaching from the command line is that there might be multiple viewers attached at the same time. Hence either there needs to be a way to specify which client to detach or all would be detached (which might not be desired in all cases).

As for killing, I agree this could be useful in some cases. It might be an option to display the server process id in the session list. That way the user could decide how to terminate the process.

After playing around with some stuff I realized that I didn't really need the detach from session feature. I was used to it from tmux where it would detach all clients.

Displaying the server pid would definitely be enough at least for my uses. Though it would be cool to be able to do something like abduco -k -9 demo to kill the session named demo.

My use case was having an emacs mode to control abduco easily

πŸ‘ for an option to print the PID of a new/named session.

I also would like to be able to detach clients (oneself or another) as a command, mostly because I don't like running applications that eat some of my input (besides the shell ofc) and I think it's better to be explicit through a command.

I suppose it could also be useful to detach a client other than the current, but I don't have a clear usecase in mind.

As of 884e3bb the session list now includes the server PID.

@jtamagnan regarding abduco -k -9 demo I would like to avoid adding further command line switches if possible. Given the new session list, it should be possible to write a script for it, if needed.

@occivink you can just kill (send SIGTERM) to any attached client, it should detach.

Sending SIGTERM to the abduco session PID (the one I want to detach) ends the session and kills any programs that were running within it on my system. What signal can be sent to detach the session rather than end it?

@DanielTD are you sure that you are not sending the signal to the server process i.e. the one printed in the session list?

If you send it to one of the clients it should detach, but keep the session running.

@martanne, indeed, you were correct. I was sending the signal to the wrong PID.

Abduco is not listing any server PID for me. Here is the output I get:

$ abduco

Active sessions (on host HOSTNAME)
* Wed 2021-01-20 11:12:39 session-name

And here is the version I am running:
$ abduco -v

abduco-0.6 Β© 2013-2016 Marc AndrΓ© Tanner

I can agree with @DanielTD, I am using the latest version in the Arch Linux repos, (version 0.6) and mine does not show session PID's aswell.

It looks like 0.6 on Github was released in 2020, but every other distro is pushing abduco-0.6 released (2016-03-24) according to the home page.

Any comment @martanne ?

mikob commented

I tried compiling from source with the latest tar here. There is no configure script, and after sudo make install I have the same 2016 version of abduco without the PIDs.
https://github.com/martanne/abduco/releases/tag/v0.6