kakounedotcom / connect.kak

Connect a program to Kakoune clients

Home Page:https://kakoune.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GIT_EDITOR=edit does not wait when running "git commit"

listentolist opened this issue · comments

Setting the GIT_EDITOR to edit gives some problems, when doing e.g. git commit in a connected terminal. The commit message is opened in the kak client, but the command does not wait, till the message is written and saved. So you just get the message Aborting commit due to empty commit message.
Is there a way, to use the "connect"-edit command in such situations? Or is the only solution to unset the GIT_EDITOR variable?

You can do send git commit, but let me think more about a proper solution.

Ok I may have a solution.

How about adding a -wait switch to the edit shell command. When specified, add a hook in the client to detach on buffer save or delete.

About the implementation, send the PID and kill.

When I think about it, there is no need, to open the GIT_EDITOR in the same client. For me the problem is solved, if I just do export GIT_EDITOR="kak -c $KAK_SESSION", as the connected terminal has to wait for the the command to be finished anyway. So it is more convenient if I don't have to switch to the other terminal window. Or are there other use cases, where it is good to open the GIT_EDITOR in the same client?

It was requested by @vbauerster in #5.

I don't mind removing it at all, if it causing such troubles.

This tig example shows, that setting GIT_EDITOR=edit can be really useful. It might be good, if there is a convenient way, how the user can set the environment variables in a connected terminal. Maybe a "connectrc" file in %val{config}, that is sourced just after the .env files in the connect-terminal and connect-shell command.

I prefer to work file-less with an option, such as connect_environment.