{"id":16614359,"url":"https://github.com/romkatv/zsh-no-ps2","last_synced_at":"2025-10-29T18:31:49.146Z","repository":{"id":206783831,"uuid":"717664251","full_name":"romkatv/zsh-no-ps2","owner":"romkatv","description":"A plugin for zsh that inserts a newline on Enter if the typed command is incomplete","archived":false,"fork":false,"pushed_at":"2024-02-22T14:07:17.000Z","size":9,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-02T04:23:52.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/romkatv.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,"dei":null}},"created_at":"2023-11-12T06:53:01.000Z","updated_at":"2025-01-21T15:28:53.000Z","dependencies_parsed_at":"2023-11-12T10:24:30.392Z","dependency_job_id":"64c5464c-147e-4fa5-afb9-b7c122e6435d","html_url":"https://github.com/romkatv/zsh-no-ps2","commit_stats":null,"previous_names":["romkatv/zsh-no-ps2"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romkatv%2Fzsh-no-ps2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romkatv%2Fzsh-no-ps2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romkatv%2Fzsh-no-ps2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romkatv%2Fzsh-no-ps2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romkatv","download_url":"https://codeload.github.com/romkatv/zsh-no-ps2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238874349,"owners_count":19545170,"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-10-12T02:05:50.002Z","updated_at":"2025-10-29T18:31:48.796Z","avatar_url":"https://github.com/romkatv.png","language":"Shell","funding_links":[],"categories":["Plugins","Shell"],"sub_categories":["ZSH on Windows"],"readme":"# zsh-no-ps2: A plugin for zsh that inserts a newline on Enter if the typed command is incomplete\n\nNormally, when you press \u003ckbd\u003eEnter\u003c/kbd\u003e in zsh, one of two things happens: if\nthe currently typed command is complete, zsh attempts to execute it; if it's\nincomplete, zsh displays the secondary prompt, also known as `PS2`, to invite\nyou to continue typing the command. When this plugin is used, \u003ckbd\u003eEnter\u003c/kbd\u003e\ninserts a newline if the typed command is incomplete. **No PS2!**\n\n*Note:* You can forcefully insert a newline by pressing \u003ckbd\u003eEscape\u003c/kbd\u003e\nfollowed by \u003ckbd\u003eEnter\u003c/kbd\u003e, or \u003ckbd\u003eAlt-Enter\u003c/kbd\u003e. This is the default\nbinding in zsh, not part of this plugin.\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [FAQ](#faq)\n  - [How do I force execution?](#how-do-i-force-execution)\n\n## Installation\n\n1. Clone the repo.\n   ```zsh\n   git clone https://github.com/romkatv/zsh-no-ps2.git ~/zsh-no-ps2\n   ```\n2. Add the following line to `~/.zshrc`:\n   ```zsh\n   source ~/zsh-no-ps2/zsh-no-ps2.plugin.zsh\n   ```\n\n*Using a plugin manager? You can install zsh-no-ps2 the same way as any other\nzsh plugin hosted on GitHub.*\n\nWhen `zsh-no-ps2.plugin.zsh` is sourced, it defines a zle widget called\n`zsh-no-ps2` and binds it to `^J` and `^M`—the two common escape sequences\nsent on \u003ckbd\u003eEnter\u003c/kbd\u003e. If you are using plugins that must be loaded after all\nwidgets have been defined (for example, [zsh-syntax-highlighting](\n  https://github.com/zsh-users/zsh-syntax-highlighting)), ensure that this\nordering requirement is respected.\n\nIf you want more control over the initialization, you can manually autoload and\nbind `zsh-no-ps2` instead of sourcing `zsh-no-ps2.plugin.zsh`.\n\nLastly, if you are using [zsh4humans](https://github.com/romkatv/zsh4humans),\nyou don't need to install this plugin. You can achieve the same effect by adding\nthe following binding to `~/.zshrc`:\n\n```zsh\nz4h bindkey z4h-accept-line Enter\n```\n\n## Configuration\n\nBy default, when the currently typed command is complete, `zsh-no-ps2` invokes\n`accept-line` zle widget. You can override this.\n\n```zsh\nzstyle :zsh-no-ps2: accept-line 'alternative-zle-widget-name'\n```\n\nUsing `.accept-line` (note the leading dot) is a reasonable option here. You can\nalso use an empty value, in which case `zsh-no-ps2` will never attempt to\nexecute commands.\n\n## FAQ\n\n### How do I force execution?\n\nSometimes you know that the command you've typed is malformed but you want to\nexecute it anyway to see `PS2` or an error message. You can do this by\nmanually executing the `accept-line` zle widget:\n\n1. Press \u003ckbd\u003eEscape\u003c/kbd\u003e followed by \u003ckbd\u003ex\u003c/kbd\u003e, or \u003ckbd\u003eAlt-x\u003c/kbd\u003e.\n2. Type `accept-line`.\n3. Press \u003ckbd\u003eEnter\u003c/kbd\u003e.\n\nIf you do this often, you can bind `accept-line` to a key. If you don't use\n\u003ckbd\u003eAlt-Enter\u003c/kbd\u003e for anything, you can use that one for forced execution.\n\n```zsh\n# Alt-Enter: Execute what's been typed even if it's malformed.\nbindkey '^[^J' accept-line\nbindkey '^[^M' accept-line\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromkatv%2Fzsh-no-ps2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromkatv%2Fzsh-no-ps2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromkatv%2Fzsh-no-ps2/lists"}