kakounedotcom / connect.kak

Connect a program to Kakoune clients

Home Page:https://kakoune.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem and suggestion for kak-desktop

useredsa opened this issue · comments

The new kak-desktop script was not working on my machine, Ubuntu 20.04 LTS with KDE. I don't know why, but it does work if I write all of the commands given to the new kakoune session in the same line:

launch() {
  file=$1 line=$2 column=$3
  kak -ui dummy -e "
    new %{  hook -always -once global ClientClose %val{client} kill! ; edit %{$file} $line $column
    }
  "
}

I believe it should work either way.

Additionally, I find quite strange kak-desktop's behaviour. If executed in a normal shell, it will open a new terminal window with kakoune, instead of opening it in the current terminal. However, if I'm using kak-shell, then it'll open it in the same terminal with the proper session. Even though I could just use kak if I want to open kakoune in this terminal, I must use kak-desktop or edit inside kak-shell. Therefore, I need to know whether I am inside the special shell or not. I believe kak-desktop should not open a new window if it's executed inside a terminal. That way, I could set my editor to kak-desktop.

I accidentally removed the feature when splitting kak-connect into kak-shell and kak-desktop.

I have assumed kak-desktop was not intended to be used directly, but as a desktop entry, by GUI apps, so I did not notice the drop of this feature.

What about the error, @alexherbo2?

It's more important for me right now. If I don't write the commands in a single line the new kakoune client won't edit the file, whether it's launched from the terminal or from a desktop file.

I cannot reproduce, running Dolphin from a launcher, without terminal, and without connection.

The launch function is only executed when there is no client to connect to and no terminal behind.

@useredsa Maybe it is because of your Kakoune version with a terminal implementation not doing a perfect forwarding?

See new from new-client.kak.

See also mawww/kakoune#3011.

You seem not affected though, as you are using kitty.

@useredsa Maybe it is because of your Kakoune version with a terminal implementation not doing a perfect forwarding?

Yes, I think that was the case. I installed kakoune using apt, which provides a rather old version. I reinstalled from source and the problem got solved.