shell-pool / shpool

Think tmux, then aim... lower
Apache License 2.0
1.15k stars 20 forks source link

Shouldn't shpool detach before attaching? #61

Closed thiswillbeyourgithub closed 3 months ago

thiswillbeyourgithub commented 3 months ago

I just noticed that we can attach sessionA then from sessionA attach sessionB and both sessionA and sessionB appear as attached. Is that intended?

ethanpailes commented 3 months ago

Yeah, this is intended and in fact required if I understand what you are saying right.

Shpool has no visibility into what is going on inside a session, so if you run shpool attach othersession inside one session, there is no way for the outer session handler to notice that and do something special. We could have the inner shpool attach process key off $SHPOOL_SESSION_NAME and do the detach, but that would still break things because the inner session has no way to attach itself to the pty that invoked the outer attach process.

If you want to switch sessions you need to detach first then attach to the new session.

thiswillbeyourgithub commented 3 months ago

Alright thanks!