{"action":"created","issue":{"url":"https://api.github.com/repos/Merovius/shellex/issues/33","labels_url":"https://api.github.com/repos/Merovius/shellex/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/Merovius/shellex/issues/33/comments","events_url":"https://api.github.com/repos/Merovius/shellex/issues/33/events","html_url":"https://github.com/Merovius/shellex/issues/33","id":124294948,"number":33,"title":"urxvt is setgid utmp","user":{"login":"Merovius","id":720787,"avatar_url":"https://avatars.githubusercontent.com/u/720787?v=3","gravatar_id":"","url":"https://api.github.com/users/Merovius","html_url":"https://github.com/Merovius","followers_url":"https://api.github.com/users/Merovius/followers","following_url":"https://api.github.com/users/Merovius/following{/other_user}","gists_url":"https://api.github.com/users/Merovius/gists{/gist_id}","starred_url":"https://api.github.com/users/Merovius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Merovius/subscriptions","organizations_url":"https://api.github.com/users/Merovius/orgs","repos_url":"https://api.github.com/users/Merovius/repos","events_url":"https://api.github.com/users/Merovius/events{/privacy}","received_events_url":"https://api.github.com/users/Merovius/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"pseyfert","id":5124749,"avatar_url":"https://avatars.githubusercontent.com/u/5124749?v=3","gravatar_id":"","url":"https://api.github.com/users/pseyfert","html_url":"https://github.com/pseyfert","followers_url":"https://api.github.com/users/pseyfert/followers","following_url":"https://api.github.com/users/pseyfert/following{/other_user}","gists_url":"https://api.github.com/users/pseyfert/gists{/gist_id}","starred_url":"https://api.github.com/users/pseyfert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pseyfert/subscriptions","organizations_url":"https://api.github.com/users/pseyfert/orgs","repos_url":"https://api.github.com/users/pseyfert/repos","events_url":"https://api.github.com/users/pseyfert/events{/privacy}","received_events_url":"https://api.github.com/users/pseyfert/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-12-30T02:27:35Z","updated_at":"2016-01-02T12:31:48Z","closed_at":null,"body":"Urxvt is setgid utmp in a recent versions. This causes ld.so to ignore LD_PRELOAD, which means we can't lie to the shell about how big the terminal really is, which breaks shellex. This *might* be the cause of #30.\r\n\r\nWe need to figure out a way to deal with this. urxvt needs to be setgid utmp, so we need to find a way different from LD_PRELOADing into urxvt to make this work. Options might be:\r\n\r\n1. Inject LD_PRELOAD into the shell and overwrite the TIOCGWINSZ ioctl (instead of the TIOCSWINSZ in urxvt) to lie to the shell instead. This might be the most practical option, though it means we need to be careful about cleaning this up in children started by shellex, so that this doesn't lead to unwanted side-effects (e.g. when starting a terminal with shellex)\r\n2. Inject the preload-library into urxvt at a later stage from the perl-plugin. It is unclear whether this is practical.\r\n3. Patch urxvt to allow overwriting the size reported via TIOCSWINSZ via the perl plugin API and getting that upstream. This means convincing upstream that this is a useful feature (and a dependency on a suitable version of urxvt)."},"comment":{"url":"https://api.github.com/repos/Merovius/shellex/issues/comments/168386537","html_url":"https://github.com/Merovius/shellex/issues/33#issuecomment-168386537","issue_url":"https://api.github.com/repos/Merovius/shellex/issues/33","id":168386537,"user":{"login":"Merovius","id":720787,"avatar_url":"https://avatars.githubusercontent.com/u/720787?v=3","gravatar_id":"","url":"https://api.github.com/users/Merovius","html_url":"https://github.com/Merovius","followers_url":"https://api.github.com/users/Merovius/followers","following_url":"https://api.github.com/users/Merovius/following{/other_user}","gists_url":"https://api.github.com/users/Merovius/gists{/gist_id}","starred_url":"https://api.github.com/users/Merovius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Merovius/subscriptions","organizations_url":"https://api.github.com/users/Merovius/orgs","repos_url":"https://api.github.com/users/Merovius/repos","events_url":"https://api.github.com/users/Merovius/events{/privacy}","received_events_url":"https://api.github.com/users/Merovius/received_events","type":"User","site_admin":false},"created_at":"2016-01-02T12:31:48Z","updated_at":"2016-01-02T12:31:48Z","body":"1. This can be solved by unsetting it in the initialization of the preloaded library itself. This guarantees that it gets loaded into exactly one process. Then one just has to make sure that it is the correct process (probably by changing the env command that urxvt executes to set it).\r\n2. The environment is the simplest, but not the only way to communicate values to child-processes. There are plenty other, so don't worry too much about that, it's not really a problem. For example: Opening a pipe before the child is created (e.g. `on_init`) and put it's fd in an environment variable. Any  child process can then read the env-var and has a bi-directional communication channel.\r\n3. Is your current state of work in the referenced commit? If so, I'm going to try it later, it's hard to get the details straight from your description :)"}}