aaronjanse / 3mux

Terminal multiplexer inspired by i3
MIT License
1.82k stars 45 forks source link

connect: no such file or directory when trying to connect to an existing session #69

Closed talentlessguy closed 3 years ago

talentlessguy commented 4 years ago

Here's what happens:

~ 
➜ 3mux
Attach to an existing session or create a new one:
> 3mux
+ create new session

I hit "Enter" and get this:

panic: dial unix /tmp/3mux/0/fd.sock: connect: no such file or directory

goroutine 1 [running]:
main.attach(0xc00001848b, 0x1)
        /home/v1rtl/go/src/github.com/aaronjanse/3mux/attach.go:36 +0x7c8
main.main()
        /home/v1rtl/go/src/github.com/aaronjanse/3mux/main.go:137 +0x695

I use v1.0.0 of 3mux and go1.14

aaronjanse commented 4 years ago

Would you mind telling me the exact steps to reproduce this, using the commands 3mux new, 3mux detach, and 3mux attach?

talentlessguy commented 4 years ago

@aaronjanse the commands are:

3mux 
New session:
3mux

Ctrl + C

and then 3mux again

aaronjanse commented 4 years ago

Ctrl + C

Hmmm. Does 3mux hang when you create a new session? If not, ctrl+c should not be possible.

Btw, which OS are you on?

aaronjanse commented 4 years ago

Oh, I just saw your other issue. You're running Linux. Stange

talentlessguy commented 4 years ago

@aaronjanse it does hang but in the background and fan starts to brrrrrrrrr so I later had to kill it.

I think that session handling is a bit buggy.

I'll try to create a session properly and open it and write if the issue persists.

aaronjanse commented 4 years ago

Oh wow, yeah, that definitely is not what's supposed to be happening. I'll try to reproduce it some time this week

kcthrn commented 4 years ago

I experienced this on Ubuntu 16.04, 20.04, Termux and Alpine PRoot in Termux. Seems like something to do with 3mux creating sessions when config.toml doesn't exist. issue-69

kcthrn commented 4 years ago

I noticed rogue 3mux _serve-id 0 processes using ~33% of CPU and ~540MB of memory. Probably from when 3mux had to be closed when it hang or restored a bad session.

aaronjanse commented 4 years ago

Ooooooohhhhh. Tysm! I'll work on a fix tomorrow. The GIF is perfect!

aaronjanse commented 4 years ago

It looks like I'll be quite busy for the next few days, so if anyone has the time to make a PR, please do.

I'd try inserting a panic statement in config.go and seeing what happens. If this intentional panic has the same effect as a missing config file, I'd look in serve.go to see why it's not handling errors properly.

Thank you, everyone, for being supportive and helpful as we work towards improving 3mux

aaronjanse commented 4 years ago

Oh, and for debugging purposes, the server can be launched with:

# wipe all sessions
pkill '3mux*' ; rm -rf /tmp/3mux

# start a session server
3mux _serve-id 0

# (in a different terminal) give the session a name then attach
echo test123 > /tmp/3mux/0/name
3mux attach test123

I should document all of this