crigler/dtach

change mode on socket on detach

Closed this issue · 2 comments

it would be nice if detach would allow for a way to figure out if a session is attached or not. screen uses the execute bit on the socket to document this: when a session is attached, it's executable, when it's not, it's not.

irssi can use that to automatically mark users as away for example.

It appears that this behaviour is already present in dtach:

$ dtach -A foo.sock bash
$ ls -l foo.sock
srwx------ 1 mrichar1 mrichar1 0 Nov 12 19:57 foo.sock
<ctrl-\>
$ ls -l foo.sock
srw------- 1 mrichar1 mrichar1 0 Nov 12 19:57 foo.sock

well dang. i could have sworn that wasn't the case. now i can write an irssi plugin, thanks! irssi/scripts.irssi.org#677