[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6458":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},6458,"reptyr","nelhage\u002Freptyr","nelhage","Reparent a running program to a new terminal","",null,"C",6283,230,91,25,0,1,7,27,5,38.09,"MIT License",false,"master",true,[],"2026-06-12 02:01:25","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\u002FARCH.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 > \u002Fproc\u002Fsys\u002Fkernel\u002Fyama\u002Fptrace_scope\n\nas root, or permanently by editing the file \u002Fetc\u002Fsysctl.d\u002F10-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:\u002F\u002Fblog.nelhage.com\u002F2011\u002F02\u002Fchanging-ctty\u002F)\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>. Contact him\nwith any questions or bug reports.\n\nURL\n---\nhttp:\u002F\u002Fgithub.com\u002Fnelhage\u002Freptyr\n","reptyr 是一个用于将正在运行的程序重新绑定到新终端的工具。它允许用户在不中断进程的情况下，将通过SSH启动的长时间运行的任务转移到如screen或tmux这样的终端复用器中继续执行。其核心功能是通过PID指定进程，并将其从当前终端分离后重新连接到新的终端上，支持Linux和FreeBSD操作系统。此工具特别适用于需要保持远程任务持续运行但又不得不离开原有SSH会话的情况，确保了用户的灵活性与工作的连续性。相比其他类似工具，reptyr 提供了更稳定的支持，包括正确处理输入输出、窗口大小调整以及信号传递等功能。",2,"2026-06-11 03:07:06","top_language"]