kakounedotcom / connect.kak

Connect a program to Kakoune clients
https://kakoune.org
The Unlicense
88 stars 18 forks source link

Close Terminal when kakoune session is killed #17

Closed basbebe closed 4 years ago

basbebe commented 4 years ago

Would it be possible to quit the terminal when the kakoune client quits?

alexherbo2 commented 4 years ago

A hook on ClientClose, killing by their PID launched apps.

https://github.com/mawww/kakoune/blob/master/doc/pages/hooks.asciidoc

alexherbo2 commented 4 years ago

@occivink How to get the PID with :terminal?

occivink commented 4 years ago

The problem is that a terminal doesn't necessarily have a pid, for example a tmux or kitty pane. We could have some kind of arbitrary identifier, along with a generic command to delete a terminal of the given id, but that gets somewhat complicated to abstract.

alexherbo2 commented 4 years ago

@basbebe Maybe the new feature of connect.kak to open in the same terminal window can match your workflow.

Example – Open a connected shell and reattach with edit:

$ kak-connect → :connect-terminal → $ edit → Quit to return to your shell

Example – Open a connected shell and lf:

$ kak-connect → :connect-terminal → $ lf → Open a file → Quit to return to lf

Example – Open lf connected to the Kakoune session:

$ kak-connect → :lf
basbebe commented 4 years ago

Sounds great, I‘ll have a look at it!