{"id":15662370,"url":"https://github.com/tatrix/tshell","last_synced_at":"2025-05-05T23:25:53.838Z","repository":{"id":49972742,"uuid":"317660582","full_name":"TatriX/tshell","owner":"TatriX","description":"Experimental alternative shell for Emacs","archived":false,"fork":false,"pushed_at":"2022-10-18T20:52:01.000Z","size":59,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T00:41:21.187Z","etag":null,"topics":["elisp","emacs","shell"],"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/TatriX.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}},"created_at":"2020-12-01T20:32:51.000Z","updated_at":"2024-12-10T10:54:08.000Z","dependencies_parsed_at":"2023-01-20T08:15:20.411Z","dependency_job_id":null,"html_url":"https://github.com/TatriX/tshell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TatriX%2Ftshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TatriX%2Ftshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TatriX%2Ftshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TatriX%2Ftshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TatriX","download_url":"https://codeload.github.com/TatriX/tshell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252591827,"owners_count":21773163,"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":["elisp","emacs","shell"],"created_at":"2024-10-03T13:32:09.957Z","updated_at":"2025-05-05T23:25:53.816Z","avatar_url":"https://github.com/TatriX.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intro\n\n`tshell` is an experimental buffer-oriented Emacs shell.\n\nIt is built around several basic ideas:\n\n- `RET` runs current line, so you can easily iterate on your one-liners\n- line prompt determines interpreter: `$` for shell, `\u003e` for elisp\n- output by default goes into a single `*tshell-out*` buffer\n- to get a named shell with history, write tshell buffer to a file, like `~/.tshell_history`\n- contents of the `*tshell-out*` buffer can be easily used as input for commands\n- create shortcuts via [transient](https://github.com/magit/transient)\n\n## Demo\nSee https://imgur.com/a/dsdKG2D\n\n## Installation\n```sh\ngit clone https://github.com/TatriX/tshell ~/.emacs.d/tshell\n```\n\n```elisp\n(use-package tshell\n  :after transient\n  :load-path \"~/.emacs.d/tshell\")\n```\nor\n```elisp\n(add-to-list 'load-path ~/.emacs.d/tshell)\n(require 'tshell)\n```\n\n### Completion\n\nThere is a very rough completion support via [fish-completion](https://gitlab.com/ambrevar/emacs-fish-completion):\n```elisp\n(use-package fish-completion\n  :config\n  (when (and (executable-find \"fish\")\n             (require 'fish-completion nil t))\n    (global-fish-completion-mode 1)))\n```\nNote that you need to have [fish](https://fishshell.\ncom/) installed.\nYou can also use [bash-completion](https://github.com/szermatt/emacs-bash-completion) as a fallback for [fish-completion](https://gitlab.com/ambrevar/emacs-fish-completion#setup).\n\n## Usage\n\nRun `M-x tshell`.\nYou can change interpreter by just editing prompt character:\n```\n$ # For example type `C-a C-k \u003e` to get\n\u003e ;; elisp interpreter\n```\nIf you want to create a new line without evaluating anything, type `C-j` or `M-j`.\n\n### Current working directory\n\nCurrent working directory is determined as in any other buffer by the\nvalue of local `default-directory` variable:\n```\n\u003e default-directory\n```\nIt is shown in the header line.\nYou can change it in multiple ways:\n```\n$ cd /tmp\n$ pwd\n```\nTyping `C-c C-d` is equivalent to `M-x cd`. That means it uses your favorite completion mechanism!\n\n#### ls\nYou probably want to see the contents of the current directory quite often.\n\nThe easiest way to do that is to type `C-c C-l`.\n\n### Input/Output redirection\n`tshell` does almost nothing to your command, so you can do pipes and redirections as usual:\n```\n$ cd ~/.emacs.d/tshell\n$ # Here I show multiple lines, but actually I just edit the same line\n$ ls\n$ ls | grep el$\n$ ls | grep el$ \u003e /tmp/files\n$ # And now open it\n$ e /tmp/files\n```\n\nBut most of the time you just want to pass contents of your `*tshell-out*` to the next command.\n```\n$ ls *md\n$ \u003e sed 's/md/org/' # Here I'm using `\u003e` to send contents of the `*tshell-out*` to stdin of `sed`\n```\nIf you realized that you need to rerun the command,\nyou can either type `C-p RET C-n` to recreate desired input\nor you can undo changes in the `*tshell-out*` buffer.\n\n#### Undo\nTo undo changes in `*tshell-out*` buffer you can run\n```\n: undo\n```\nor just switch to the `*tshell-out*` buffer and use your regular undo keybinding, like `C-/`.\n\n#### History variables\nEvery time you evaluate a lisp command, result of the evaluation is stored in variable `*`\n```\n\u003e (+ 13 69) # 82\n\u003e (+ 42 *) # 124\n```\n`*` is a regular elisp variable, so you can use it in any other context, like `*scratch*` buffer or `M-x eval`.\n\n### Misc\nYou can type `C-c C-y` to insert contents of the `*tshell-out*` buffer at point:\n```\n$ locate tshell | grep 'el$'\n$ e # Type `C-c C-y`\n$ e /home/tatrix/.emacs.d/tshell/tshell.el # `e` is a special command which opens file in the emacs buffer\n```\n\n## Customization\n\nYou can customize how your prompt looks:\n```elisp\n(setq tshell-shell-prompt \"zsh\u003e\")\n(setq tshell-elisp-prompt \"elisp\u003e\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftatrix%2Ftshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftatrix%2Ftshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftatrix%2Ftshell/lists"}