kakounedotcom / connect.kak

Connect a program to Kakoune clients

Home Page:https://kakoune.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get freezes when the expansion is invalid

danr opened this issue · comments

Hi Alex, a little late to the connect.kak party but it seems like a nice party nevertheless :) I noticed this:

If you run get val it blocks indefinitely in the connected terminal with this error message written to *debug*:

error running command 'evaluate-commands -client %(client0) %(echo -to-file %(/tmp/tmp.XzXwQRPVR3/fifo) %val())': 1:1: 'evaluate-commands' no such env var: 

Same if you run get val x etc

Possible fix: wrap a try around the echo and if an error is caught write the debug message to the fifo.

Hi @danr,

In your PR, can [1] be replaced with [2]?, or it does not work.

[1]:

(eval "$@" &) < /dev/null > /dev/null 2>&1

[2]:

"$@" < /dev/null > /dev/null 2>&1 &

As "$@" splits, I wonder if eval is really needed.

I guess you're talking about #4? This issue is about get: https://github.com/alexherbo2/connect.kak/blob/master/rc/commands/get

Good question about eval: why was it there in the first place? 🤔

About eval, because my sh-fu was limited, I didn’t know just "$@" could work.

Fixed o/