Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

kak-shell: how to create new session? #48

Open
basbebe opened this issue Feb 2, 2021 · 11 comments
Open

kak-shell: how to create new session? #48

basbebe opened this issue Feb 2, 2021 · 11 comments

Comments

@basbebe
Copy link
Contributor

basbebe commented Feb 2, 2021

Hi!

I have two questions about kak-shell.

I don't know if I'm holding it wrong or there's a problem with my setup.

I see that there is a way to create a new session but I don't know how?
Whatever I enter when the prompt comes, nothing happens and the prompt never stops…

And: Since kak-shell always opens with a prompt, I assume the desired thing to do in scripts is not to use kak-shell but kak -c $session and maybe kak -c "$session" -e "connect-detach; sh connect.sh?

@alexherbo2
Copy link
Collaborator

kak-shell should prompt you to connect to a session or create a new session. Enter for example kanto. When connected, enter a command like :attach.

@basbebe
Copy link
Contributor Author

basbebe commented Feb 3, 2021

I rebuilt kakoune from source to verify but I keep having this problem:

Bildschirmfoto 2021-02-03 um 08 16 38

In the meantime when I do this with anpther session open, I get this in the debug of the other session, even if I try to create a new one:

Bildschirmfoto 2021-02-03 um 08 24 05

@alexherbo2
Copy link
Collaborator

I have no idea. Can you try to edit connect.kak files to find the problem?

There is kak-shell here. Maybe other files to edit.

@basbebe
Copy link
Contributor Author

basbebe commented Feb 3, 2021

I will as soon as I get into it!

@basbebe
Copy link
Contributor Author

basbebe commented Feb 3, 2021

found the problem: not all Unixes come with setsid – espacially not macOS.

Solution:

  • remove setsid from kak-shell

or

@alexherbo2
Copy link
Collaborator

I remember without setsid, it kills my programs on Control + d in Elvish.

@basbebe
Copy link
Contributor Author

basbebe commented Feb 3, 2021

I remember without setsid, it kills my programs on Control + d in Elvish.

yep, same with fish.

this seems to work though (invoke subshell):

  ( kak -s "$session" -d < /dev/null > /dev/null 2>&1 ) &

(btw: will need to try out elvish, thanks)

@alexherbo2
Copy link
Collaborator

What is the difference between { ... } and (...)?

@basbebe
Copy link
Contributor Author

basbebe commented Feb 4, 2021

to my understanding, { … } is a brace expansion (https://ss64.com/bash/syntax-expand.html), whereas ( … ) invokes a subshell (https://tldp.org/LDP/abs/html/subshells.html).

@basbebe
Copy link
Contributor Author

basbebe commented Feb 4, 2021

( kak -s "$session" -d < /dev/null > /dev/null 2>&1 ) &

btw. using this ⬆️ seems to get rid of #53 (but produces another bug when callein :new from a connected client which results in a loop and an exit of kak-shell)

@basbebe
Copy link
Contributor Author

basbebe commented Feb 4, 2021

this also works univerally (but creates the same error for me as above):

  env session=$session $SHELL -c 'kak -s "$session" -d < /dev/null > /dev/null 2>&1 &'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants