{"action":"created","issue":{"url":"https://api.github.com/repos/rcaloras/bash-preexec/issues/39","repository_url":"https://api.github.com/repos/rcaloras/bash-preexec","labels_url":"https://api.github.com/repos/rcaloras/bash-preexec/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/rcaloras/bash-preexec/issues/39/comments","events_url":"https://api.github.com/repos/rcaloras/bash-preexec/issues/39/events","html_url":"https://github.com/rcaloras/bash-preexec/issues/39","id":227240556,"number":39,"title":"Preserve existing DEBUG traps ","user":{"login":"brandonweeks","id":15869,"avatar_url":"https://avatars2.githubusercontent.com/u/15869?v=4","gravatar_id":"","url":"https://api.github.com/users/brandonweeks","html_url":"https://github.com/brandonweeks","followers_url":"https://api.github.com/users/brandonweeks/followers","following_url":"https://api.github.com/users/brandonweeks/following{/other_user}","gists_url":"https://api.github.com/users/brandonweeks/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonweeks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonweeks/subscriptions","organizations_url":"https://api.github.com/users/brandonweeks/orgs","repos_url":"https://api.github.com/users/brandonweeks/repos","events_url":"https://api.github.com/users/brandonweeks/events{/privacy}","received_events_url":"https://api.github.com/users/brandonweeks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-05-09T03:38:24Z","updated_at":"2017-07-18T09:31:51Z","closed_at":null,"body":"Currently bash-preexec clobbers existing DEBUG traps when it is sourced. Would you be interested in a PR that moves the contents of `trap -p DEBUG` into a function and appends it to `preexec_functions`?"},"comment":{"url":"https://api.github.com/repos/rcaloras/bash-preexec/issues/comments/316010252","html_url":"https://github.com/rcaloras/bash-preexec/issues/39#issuecomment-316010252","issue_url":"https://api.github.com/repos/rcaloras/bash-preexec/issues/39","id":316010252,"user":{"login":"dimo414","id":1885701,"avatar_url":"https://avatars1.githubusercontent.com/u/1885701?v=4","gravatar_id":"","url":"https://api.github.com/users/dimo414","html_url":"https://github.com/dimo414","followers_url":"https://api.github.com/users/dimo414/followers","following_url":"https://api.github.com/users/dimo414/following{/other_user}","gists_url":"https://api.github.com/users/dimo414/gists{/gist_id}","starred_url":"https://api.github.com/users/dimo414/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimo414/subscriptions","organizations_url":"https://api.github.com/users/dimo414/orgs","repos_url":"https://api.github.com/users/dimo414/repos","events_url":"https://api.github.com/users/dimo414/events{/privacy}","received_events_url":"https://api.github.com/users/dimo414/received_events","type":"User","site_admin":false},"created_at":"2017-07-18T09:31:51Z","updated_at":"2017-07-18T09:31:51Z","body":"Well that's clever :) It would not have crossed my mind to try that. In that case it seems like it should be possible to add the trap to `preexec_functions` with something like:\r\n\r\n    preexec_functions+=(\"$(trap -p DEBUG | sed -e \"s/trap -- '//\" -e \"s/' DEBUG//\")\")\r\n\r\nThere's probably a better way to extract the DEBUG command, but that worked in a pinch. I take it your open to a pull request adding something along these lines?"}}
{"actor":{"display_login":"dimo414"}}