kakounedotcom / connect.kak

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

make kak-shell scriptable #52

Closed basbebe closed 3 years ago

basbebe commented 3 years ago

I would love to ahve the possibility to make kak-shell scriptable.

What do I mean?

E.g. I have a fish function that does:

At this point, when I want to leverage all that awesome connect.kak functionality, I would have to more or less re-write kak-shell in the fish function:

instantiate session in the background, wait, connect client, issue connect-detach, sh connect.sh, open ide.

What I would like to do would be: kak-shell -n sessionname and that would open a new kak-shell with a new session 'sessionname'.

alexherbo2 commented 3 years ago

In short, you want to connect to a session from the command-line without a prompt?

basbebe commented 3 years ago

yes. Or create that session if it doesn't exist yet.

alexherbo2 commented 3 years ago

How about:

kak-shell [session] [commands]

Example – Without a prompt:

kak-shell kanto :attach

Example – With a prompt:

kak-shell '' :attach
basbebe commented 3 years ago

would be great I think

alexherbo2 commented 3 years ago

@basbebe Tell me if the UI is good. The prompt thing was inspired by 3mux. But now we can connect to a session without a prompt with:

kak-shell [session] [commands]

To be prompted and execute a command, we use an empty session:

kak-shell '' :attach

Which can be surprising in terms of UI.

basbebe commented 3 years ago

I like the functionality but I also think the UI isn't intuitive. kak-shell :attach now ends in an infinite loop.

I personally would prefer flags like kak-shell -s kanto :attach which wouldn't break kak-shell :attach.