crigler / dtach

A simple program that emulates the detach feature of screen
GNU General Public License v2.0
492 stars 50 forks source link

change mode on socket on detach #17

Closed anarcat closed 5 years ago

anarcat commented 5 years ago

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.

mrichar1 commented 5 years ago

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
anarcat commented 5 years ago

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