mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.7k stars 705 forks source link

[REQUEST] `close-daemonized-session` command #5169

Closed VKondakoff closed 1 month ago

VKondakoff commented 1 month ago

Feature

Hi!

daemonize-session is a great addition, but I think there is a need to introduce a command for the opposite - close the specified daemonized session.

Usecase

Here is a scenario: I launch several Kakoune instances without any command line options, then I use the daemonize-session command in one of the instances. Now how can I kill the server (for example, to reload the config files)? As there were no command line options they all looks the same in ps output:

Снимок экрана 2024-05-09 в 14 21 55

How can I decide wich of the sessions to kill? So, I think there should be a Kakoune command to exit the specified server.

krobelus commented 1 month ago

Now how can I kill the server

echo kill | kak -p session_name

VKondakoff commented 1 month ago

Ah, that was easy. Silly me! Thank you, closing the FR.

Screwtapello commented 1 month ago

In the default configuration of Kakoune, in the bottom right of the window it will say something like "client0@[1228735]`, which is the expansion of "%val{client}@[%val{session}]".

So if you can see a client connected to the session you want to shut down, you can get the session name... or you can just type :kill<ret> in that client.

VKondakoff commented 1 month ago

So if you can see a client connected to the session you want to shut down, you can get the session name... or you can just type :kill in that client.

Yes, thank you. This is the first time I have heard about kill command. ;(

Here are the docs:

kill[!] [<exit status>]
terminate the current session, all the clients as well as the server. If specified, the server and clients exit status will be set to <exit status>