kakounedotcom / connect.kak

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

Problem and suggestion for kak-desktop #19

Closed useredsa closed 4 years ago

useredsa commented 4 years ago

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.

alexherbo2 commented 4 years ago

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

alexherbo2 commented 4 years ago

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.

useredsa commented 4 years ago

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.

alexherbo2 commented 4 years ago

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.

alexherbo2 commented 4 years ago

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

See new from new-client.kak.

alexherbo2 commented 4 years ago

See also https://github.com/mawww/kakoune/issues/3011.

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

useredsa commented 4 years ago

@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.