{"id":13894841,"url":"https://github.com/colonelpanic8/term-manager","last_synced_at":"2025-12-11T18:52:21.715Z","repository":{"id":142768951,"uuid":"60123254","full_name":"colonelpanic8/term-manager","owner":"colonelpanic8","description":"Manage ansi-term buffers using projectile","archived":false,"fork":false,"pushed_at":"2024-08-11T23:37:23.000Z","size":75,"stargazers_count":32,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-19T13:45:32.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colonelpanic8.png","metadata":{"files":{"readme":"README.org","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-31T21:03:01.000Z","updated_at":"2024-08-11T23:37:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa8a0c1e-04df-4310-834a-862feac8d113","html_url":"https://github.com/colonelpanic8/term-manager","commit_stats":null,"previous_names":["colonelpanic8/term-manager"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Fterm-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Fterm-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Fterm-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Fterm-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colonelpanic8","download_url":"https://codeload.github.com/colonelpanic8/term-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243293794,"owners_count":20268142,"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":[],"created_at":"2024-08-06T18:01:48.126Z","updated_at":"2025-12-11T18:52:16.670Z","avatar_url":"https://github.com/colonelpanic8.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"term-manager [[http://melpa.org/#/term-manager][file:http://melpa.org/packages/term-manager-badge.svg]] [[https://stable.melpa.org/#/term-manager][file:https://stable.melpa.org/packages/term-manager-badge.svg]]\n\nterm-projectile [[http://melpa.org/#/term-projectile][file:http://melpa.org/packages/term-projectile-badge.svg]]\n[[https://stable.melpa.org/#/term-projectile][file:https://stable.melpa.org/packages/term-projectile-badge.svg]]\n\n* About\n~term-projectile~ manages terminals in groups based on the current projectile context. With a single keystroke, it will either create a new terminal for the current project, or take you to one that already exists. If more than one terminal exists for your project, it will let you easily cycle through those existing terminals. ~term-manager~ is used to support ~term-projectile~, though it can theoretically be used without ~term-projectile~.\n* Installation\nInstall from MELPA with ~M-x package-install term-projectile~. See the [[https://github.com/milkypostman/melpa][melpa repository]] for details about how to set up MELPA if you have not already done so.\n* Setup\n** Emacs Configuration\nThe author ([[http://ivanmalison.github.io/dotfiles/#termprojectile][config here]]) prefers to set up term-projectile using the following (now quite complicated) [[https://github.com/abo-abo/hydra][hydra]]:\n#+BEGIN_SRC emacs-lisp\n(defun imalison:maybe-symbol-name (arg)\n  (if (symbolp arg)\n      (symbol-name arg)\n    arg))\n\n(defun imalison:concat-symbols (\u0026rest args)\n  (intern (mapconcat 'imalison:maybe-symbol-name args \"\")))\n\n(defvar imalison:term-hydra-original-default-directory)\n\n(defhydra imalison:term-hydra-default-directory\n  (:body-pre\n   (term-projectile-default-directory-forward-restored))\n  \"term - default-directory\"\n  (\"f\" term-projectile-default-directory-forward-restored)\n  (\"b\" term-projectile-default-directory-backward-restored)\n  (\"c\" term-projectile-default-directory-create-new-restored)\n  (\"d\" term-projectile-default-directory-forward-restored)\n  (\"g\" imalison:term-hydra-global/body-restored :exit t)\n  (\"p\" imalison:term-hydra-projectile/body-restored :exit t))\n\n(defhydra imalison:term-hydra-projectile\n  (:body-pre\n   (progn\n     (term-projectile-forward-restored)))\n  \"term - projectile\"\n  (\"f\" term-projectile-forward-restored)\n  (\"b\" term-projectile-backward-restored)\n  (\"c\" term-projectile-create-new-restored)\n  (\"d\" imalison:term-hydra-default-directory/body-restored :exit t)\n  (\"g\" imalison:term-hydra-global/body-restored :exit t)\n  (\"p\" term-projectile-forward-restored))\n\n\n(defhydra imalison:term-hydra-global\n  (:body-pre\n   (progn (setq imalison:term-hydra-original-default-directory\n                default-directory)\n          (term-projectile-global-forward-restored)))\n  \"term - global\"\n  (\"f\" term-projectile-global-forward-restored)\n  (\"b\" term-projectile-global-backward-restored)\n  (\"c\" term-projectile-global-create-new-restored)\n  (\"d\" imalison:term-hydra-default-directory/body-restored :exit t)\n  (\"g\" term-projectile-global-forward-restored)\n  (\"p\" imalison:term-hydra-projectile/body-restored :exit t))\n\n(mapcar (lambda (term-projectile-function)\n          (defalias (imalison:concat-symbols term-projectile-function '-restored)\n            (lambda (\u0026rest args)\n              (interactive)\n              (let ((default-directory imalison:term-hydra-original-default-directory))\n                (apply term-projectile-function args)))))\n        '(term-projectile-default-directory-forward\n          term-projectile-default-directory-backward\n          term-projectile-default-directory-create-new\n          term-projectile-forward\n          term-projectile-backward\n          term-projectile-create-new\n          term-projectile-global-forward\n          term-projectile-global-backward\n          term-projectile-global-create-new\n          imalison:term-hydra-global/body\n          imalison:term-hydra-projectile/body\n          imalison:term-hydra-default-directory/body))\n#+END_SRC\n\n When term-projectile-forward is executed in a projectile project where no terminal currently exists, a new ansi-term instance will be created. If one already exists, pressing that key binding will take the user to the existing ansi-term instance for that project.\n\n** Terminal Support\nTo get automatic directory changing You will need to add something like the\nfollowing to your shell's configuration file, along with the snippet from one of\nthe headings below that corresponds to your shell of choice.\n#+BEGIN_SRC sh\nfunction environment_variable_exists {\n    eval \"value=\\\"\\${$1+x}\\\"\"\n    [ ! -z $value ]\n}\n\nfunction emacs_ansi_term_support {\n    echo -e \"\\033AnSiTu\" \"$LOGNAME\" # $LOGNAME is more portable than using whoami.\n    echo -e \"\\033AnSiTc\" \"$(pwd)\"\n    if [ $(uname) = \"SunOS\" ]; then\n        # The -f option does something else on SunOS and is not needed anyway.\n        hostname_options=\"\";\n    else\n        hostname_options=\"-f\";\n    fi\n    # XXX/TODO: This disables correct setting of the current directory\n    # when in an sshed shell when inside of emacs\n    # echo -e \"\\033AnSiTh\" \"$(hostname $hostname_options)\" # Using the -f option can #\n    # cause problems on some OSes.\n}\n#+END_SRC\n*** zsh\n #+BEGIN_SRC sh\nif environment_variable_exists INSIDE_EMACS; then\n    if [[ $INSIDE_EMACS == *\"term\"* ]]\n    then\n        add-zsh-hook precmd emacs_ansi_term_support\n    fi\nfi\n #+END_SRC\n*** bash\n #+BEGIN_SRC sh\nif environment_variable_exists INSIDE_EMACS; then\n    if [[ $INSIDE_EMACS == *\"term\"* ]]\n    then\n        PROMPT_COMMAND='emacs_ansi_term_support'\n    fi\nfi\n #+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolonelpanic8%2Fterm-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolonelpanic8%2Fterm-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolonelpanic8%2Fterm-manager/lists"}