{"id":2769285,"url":"https://github.com/anki-code/xonsh-prewarmed","last_synced_at":"2025-10-28T03:31:54.918Z","repository":{"id":219708710,"uuid":"649660467","full_name":"anki-code/xonsh-prewarmed","owner":"anki-code","description":"Run interactive xonsh shell session in milliseconds using prewarmed session from the background. ","archived":false,"fork":false,"pushed_at":"2024-12-25T16:17:45.000Z","size":47,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T11:11:05.548Z","etag":null,"topics":["gnu-screen","tmux","tmux-plugin","xonsh","xontrib"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anki-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-05T11:09:16.000Z","updated_at":"2024-12-25T16:17:48.000Z","dependencies_parsed_at":"2024-01-29T10:23:21.516Z","dependency_job_id":"beb20c40-3367-4f73-a966-5d5363e99338","html_url":"https://github.com/anki-code/xonsh-prewarmed","commit_stats":null,"previous_names":["anki-code/xonsh-prewarmed"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxonsh-prewarmed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxonsh-prewarmed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxonsh-prewarmed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxonsh-prewarmed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anki-code","download_url":"https://codeload.github.com/anki-code/xonsh-prewarmed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238590596,"owners_count":19497350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gnu-screen","tmux","tmux-plugin","xonsh","xontrib"],"created_at":"2024-01-29T09:34:00.911Z","updated_at":"2025-10-28T03:31:54.914Z","avatar_url":"https://github.com/anki-code.png","language":"Shell","funding_links":[],"categories":["Integrations"],"sub_categories":["Prompt tweaks"],"readme":"\u003cp align=\"center\"\u003e\n\u003cb\u003exonsh-prewarmed\u003c/b\u003e is to run interactive \u003ca href=\"https://xon.sh\"\u003exonsh\u003c/a\u003e session in milliseconds using prewarmed session from the background screen.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e  \nIf you like the idea click ⭐ on the repo and and \u003ca href=\"https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!\u0026url=https://github.com/anki-code/xonsh-prewarmed\" target=\"_blank\"\u003etweet\u003c/a\u003e.\n\u003c/p\u003e\n\n## How it works\n\nOn first run of `xonsh-prewarmed-*` script it creates additional reserved xonsh session in the background. On the next runs of the script it uses the reserved sessions and create new reserved sessions in the background. As result the speed of run the new interactive xonsh sessions is milliseconds.\n\n## Installation\n\n```xsh\ngit clone https://github.com/anki-code/xonsh-prewarmed\ncd xonsh-prewarmed\nchmod +x xonsh-prewarmed-*\n```\n\n## Usage\n\n[GNU Screen](https://www.gnu.org/software/screen/):\n```xsh\n./xonsh-prewarmed-screen\n```\n[Tmux](https://github.com/tmux/tmux/wiki):\n```xsh\n./xonsh-prewarmed-tmux\n```\n[zellij](https://zellij.dev/):\n```xsh\n./xonsh-prewarmed-zellij\n```\n\n### Detect that xonsh was prewarmed \n\nUse `XONSH_PREWARMED` environment variable to detect that xonsh was prewarmed in `~/.xonshrc`:\n\n```xsh\nif __xonsh__.env.get('XONSH_PREWARMED', False):\n    print('This xonsh session was prewarmed!')\n```\n\n## Cheatsheet\n\n### Share history between sessions\n\nIf you're using SQLite history backend in xonsh you can use `history pull` command to get history from other sessions.\n\n### GNU Screen\n\nBasics:\n\n* When you run `screen` the new session will be started and your current terminal will be attached to it.\n* You can put the screen session to background by pressing `Ctrl + a` and then press `d`. After this your terminal will be detached from the session but the session will stay active in background.\n* Run `screen -ls` to get list of all sessions. The `sess_id` is the number before dot.\n* Run `screen -r \u003csess_id\u003e` to attach `Detached` session to the current terminal.\n* Run `screen -rd \u003csess_id\u003e` to detach the `Attached` session and attach to the current terminal.\n* Run `env | grep STY` to get current `sess_id`.\n\n## Add another session manager\n\nFeel free to add another session manager (e.g. `zellij`) by creating `xonsh-prewarmed-\u003cmanager\u003e`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanki-code%2Fxonsh-prewarmed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanki-code%2Fxonsh-prewarmed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanki-code%2Fxonsh-prewarmed/lists"}