{"id":13439111,"url":"https://github.com/nelhage/reptyr","last_synced_at":"2026-10-18T23:10:30.724Z","repository":{"id":1309555,"uuid":"1252864","full_name":"nelhage/reptyr","owner":"nelhage","description":"Reparent a running program to a new terminal","archived":false,"fork":false,"pushed_at":"2026-10-05T22:33:39.000Z","size":371,"stargazers_count":6351,"open_issues_count":28,"forks_count":230,"subscribers_count":91,"default_branch":"master","last_synced_at":"2026-10-15T04:55:09.114Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nelhage.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-01-14T00:33:50.000Z","updated_at":"2026-10-14T18:33:54.000Z","dependencies_parsed_at":"2025-01-30T10:00:38.724Z","dependency_job_id":"e557442f-706d-41ba-b2c2-cca9e0bbde93","html_url":"https://github.com/nelhage/reptyr","commit_stats":{"total_commits":268,"total_committers":42,"mean_commits":6.380952380952381,"dds":0.3395522388059702,"last_synced_commit":"fe2fdb1336cef8667a23eaab9cfbe7165f11807b"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/nelhage/reptyr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelhage%2Freptyr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelhage%2Freptyr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelhage%2Freptyr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelhage%2Freptyr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nelhage","download_url":"https://codeload.github.com/nelhage/reptyr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelhage%2Freptyr/sbom","scorecard":{"id":679114,"data":{"date":"2025-08-11","repo":{"name":"github.com/nelhage/reptyr","commit":"e294304ae065e9de52769c0e21e3ed8106c2fbde"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":7,"reason":"Found 8/11 approved changesets -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel permissions set to 'read-all': .github/workflows/ci.yml:10","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/nelhage/reptyr/ci.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:29","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: COPYING:0","Info: FSF or OSI recognized license: MIT License: COPYING:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T22:31:21.111Z","repository_id":1309555,"created_at":"2025-08-21T22:31:21.111Z","updated_at":"2025-08-21T22:31:21.111Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38343411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-18T02:00:06.448Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:11.227Z","updated_at":"2026-10-18T23:10:30.383Z","avatar_url":"https://github.com/nelhage.png","language":"C","funding_links":[],"categories":["C","Other","HarmonyOS","others","\u003ca name=\"tooling\"\u003e\u003c/a\u003etooling","[🧑‍💻 dev](https://github.com/stars/ketsapiwiq/lists/dev)"],"sub_categories":["Scientific Computing","Windows Manager"],"readme":"reptyr - A tool for \"re-ptying\" programs.\n=========================================\n\nreptyr is a utility for taking an existing running program and\nattaching it to a new terminal. Started a long-running process over\nssh, but have to leave and don't want to interrupt it? Just start a\nscreen, use reptyr to grab it, and then kill the ssh session and head\non home.\n\nUSAGE\n-----\n\n    reptyr PID\n\n\"reptyr PID\" will grab the process with id PID and attach it to your\ncurrent terminal.\n\nAfter attaching, the process will take input from and write output to\nthe new terminal, including ^C and ^Z. (Unfortunately, if you\nbackground it, you will still have to run \"bg\" or \"fg\" in the old\nterminal. This is likely impossible to fix in a reasonable way without\npatching your shell.)\n\nTypical usage pattern\n---------------------\n\n* Start a long running process, e.g. `top`\n* Background the process with CTRL-Z\n* Resume the process in the background: `bg`\n* Display your running background jobs with `jobs -l`, this should look like this:\n  * `[1]+  4711 Stopped (signal)        top`\n  * (The `-l` in `jobs -l` makes sure you'll get the PID)\n* Disown the jobs from the current parent with `disown top`. After that, `jobs` will not show the job any more, but `ps -a` will.\n* Start your terminal multiplexer of choice, e.g. `tmux`\n* Reattach to the backgrounded process: `reptyr 4711`\n* Detach your terminal multiplexer (e.g. CTRL-A D) and close ssh\n* Reconnect ssh, attach to your multiplexer (e.g. `tmux attach`), rejoice!\n\n\"But wait, isn't this just screenify?\"\n--------------------------------------\n\nThere's a shell script called \"screenify\" that's been going around the\ninternet for nigh on 10 years now that uses gdb to (supposedly)\naccomplish the same thing. The difference is that reptyr works much,\nmuch, better.\n\nIf you attach a \"less\" using screenify, it will still take input from\nthe old terminal. If you attach an ncurses program using screenify,\nand resize the window, your program won't notice. If you attach a\nprocess with screenify, ^C in the new terminal won't work.\n\nreptyr fixes all of these problems, and is the only such tool I know\nof that does so. See below for some more details on how it\naccomplishes this.\n\nPORTABILITY\n-----------\n\nreptyr supports Linux and FreeBSD. Not all functionality is currently\navailable on FreeBSD. (Notably, FreeBSD doesn't support `reptyr -T` at\nthis time.\n\n`reptyr` uses ptrace to attach to the target and control it at the\nsyscall level, so it is highly dependent on details of the syscall\nAPI, available syscalls, and terminal ioctl()s. A port to other\noperating systems may be technically feasible, but requires\nsignificant low-level knowledge of the relevant platform, and may\nentail significant refactors.\n\nreptyr works on i386, x86_64, and ARM. Ports to other architectures should be\nstraightforward, and should in most cases be as simple as adding an arch/ARCH.h\nfile and adding a clause to the ifdef ladder in ptrace.c.\n\nptrace_scope on Ubuntu Maverick and up\n--------------------------------------\n\n`reptyr` depends on the `ptrace` system call to attach to the remote program. On\nUbuntu Maverick and higher, this ability is disabled by default for security\nreasons. You can enable it temporarily by doing\n\n    # echo 0 \u003e /proc/sys/kernel/yama/ptrace_scope\n\nas root, or permanently by editing the file /etc/sysctl.d/10-ptrace.conf, which\nalso contains more information about exactly what this setting accomplishes.\n\nreptyr -l\n---------\n\nAs a bonus feature, if you run \"reptyr -l\", reptyr will create a new\npseudo-terminal pair with nothing attached to the slave end, and print\nits name out.\n\nIf you are debugging a program in gdb, you can pass that name to \"set\ninferior-pty\". Because there is no existing program listening to that\ntty, this will work much better than passing an existing shell's\nterminal.\n\nHow does it work?\n-----------------\n\nThe main thing that reptyr does that no one else does is that it\nactually changes the controlling terminal of the process you are\nattaching. I wrote a\n[blog post](https://blog.nelhage.com/2011/02/changing-ctty/)\nexplaining just what the shenanigans involved are.\n\nPRONUNCIATION\n-------------\n\nI pronounce it like \"repeater\", but since that's easily ambiguous,\n\"re-P-T-Y-er\" is also acceptable.\n\n\nCREDITS\n-------\nreptyr was written by Nelson Elhage \u003cnelhage@nelhage.com\u003e. Contact him\nwith any questions or bug reports.\n\nURL\n---\nhttp://github.com/nelhage/reptyr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelhage%2Freptyr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnelhage%2Freptyr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelhage%2Freptyr/lists"}