├── .editorconfig ├── .github └── workflows │ └── bump-homebrew-formula-on-release-publication.yaml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── ROADMAP.md ├── git-replay.yaml ├── man └── man1 │ └── zwt.1 ├── zsh-window-title.plugin.zsh └── zsh-window-title.zsh /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://EditorConfig.org 2 | 3 | root = true 4 | 5 | # Unix-style newlines with a newline ending every file 6 | [*] 7 | indent_style = tab 8 | indent_size = 4 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | indent_style = space 17 | 18 | [*.csv] 19 | insert_final_newline = false 20 | -------------------------------------------------------------------------------- /.github/workflows/bump-homebrew-formula-on-release-publication.yaml: -------------------------------------------------------------------------------- 1 | name: Bump Homebrew Formula on Release Publication 2 | 3 | on: 4 | release: 5 | types: [released] 6 | jobs: 7 | homebrew: 8 | name: Bump Homebrew formula 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # v3.1 12 | with: 13 | formula-name: zsh-window-title 14 | formula-path: zsh-window-title.rb 15 | homebrew-tap: olets/homebrew-tap 16 | commit-message: | 17 | feat({{formulaName}}): publish {{version}} 18 | 19 | Created by https://github.com/mislav/bump-homebrew-formula-action 20 | via the https://github.com/olets/zsh-window-title 21 | "bump-homebrew-formula-on-release-publication" workflow 22 | env: 23 | COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # [v1.2.0](https://github.com/olets/zsh-window-title/compare/v1.1.3...v1.2.0) (2024-05-23) 2 | 3 | ### Features 4 | 5 | 6 | * **tmux:** support [[#5](https://github.com/olets/zsh-window-title/issues/5)]. Thanks to @smeetrs ([9438a66](https://github.com/olets/zsh-window-title/commit/9438a666ea3c24bade64fbd03336b2b8c7ba50dd)) 7 | 8 | 9 | # [v1.1.3](https://github.com/olets/zsh-window-title/compare/v1.1.2...v1.1.3) (2024-05-16) 10 | 11 | 12 | ### Bug Fixes 13 | 14 | * **preexec:** play nice with inline zsh scripts... ([b1ddc56](https://github.com/olets/zsh-window-title/commit/b1ddc5637abf0ff06f4cddb5b0b75575d921ef70)) 15 | 16 | 17 | 18 | # [v1.1.2](https://github.com/olets/zsh-window-title/compare/v1.1.1...v1.1.2) (2024-05-15) 19 | 20 | Continued GitHub Actions work. 21 | 22 | # [v1.1.1](https://github.com/olets/zsh-window-title/compare/v1.1.0...v1.1.1) (2024-05-15) 23 | 24 | Fix GitHub Actions. 25 | 26 | # [v1.1.0](https://github.com/olets/zsh-window-title/compare/v1.0.2...v1.1.0) (2024-05-15) 27 | 28 | 29 | ### Features 30 | 31 | * **prefixes:** support + new ZSH_WINDOW_TITLE_COMMAND_PREFIXES [[#6](https://github.com/olets/zsh-window-title/issues/6)] ([2b1c741](https://github.com/olets/zsh-window-title/commit/2b1c74107035ade8148d51d666fd1ce0dcff435e)) 32 | 33 | 34 | 35 | # [v1.0.2](https://github.com/olets/zsh-window-title/compare/v1.0.1...v1.0.2) (2021-09-27) 36 | 37 | 38 | ### Bug Fixes 39 | 40 | * **debug:** user can turn on debugging ([b42cb2b](https://github.com/olets/zsh-window-title/commit/b42cb2b342ec1f93b6b3f8a57a52708416be7deb)) 41 | 42 | 43 | ### Features 44 | 45 | * **editorconfig:** add config ([dbd0196](https://github.com/olets/zsh-window-title/commit/dbd01969fbdf1ef3df431033db83f87243cc4ca2)) 46 | 47 | 48 | 49 | # [v1.0.1](https://github.com/olets/zsh-window-title/compare/v1.0.0...v1.0.1) (2021-09-24) 50 | 51 | 52 | ### Bug Fixes 53 | 54 | * **init:** respect depth setting ([6cdb0e7](https://github.com/olets/zsh-window-title/commit/6cdb0e72cda4379f2c36639f83c4128718230365)) 55 | 56 | 57 | 58 | # [v1.0.0](https://github.com/olets/zsh-window-title/compare/v0...v1.0.0) (2021-09-24) 59 | 60 | Initial release 61 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 7 | 8 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 9 | 10 | ## Our Standards 11 | 12 | Examples of behavior that contributes to a positive environment for our community include: 13 | 14 | * Demonstrating empathy and kindness toward other people 15 | * Being respectful of differing opinions, viewpoints, and experiences 16 | * Giving and gracefully accepting constructive feedback 17 | * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 18 | * Focusing on what is best not just for us as individuals, but for the overall community 19 | 20 | Examples of unacceptable behavior include: 21 | 22 | * The use of sexualized language or imagery, and sexual attention or 23 | advances of any kind 24 | * Trolling, insulting or derogatory comments, and personal or political attacks 25 | * Public or private harassment 26 | * Publishing others' private information, such as a physical or email 27 | address, without their explicit permission 28 | * Other conduct which could reasonably be considered inappropriate in a 29 | professional setting 30 | 31 | ## Enforcement Responsibilities 32 | 33 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 34 | 35 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 36 | 37 | ## Scope 38 | 39 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 40 | 41 | ## Enforcement 42 | 43 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement (Henry Bley-Vroman) at olets@olets.dev. All complaints will be reviewed and investigated promptly and fairly. 44 | 45 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 46 | 47 | ## Enforcement Guidelines 48 | 49 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 50 | 51 | ### 1. Correction 52 | 53 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 54 | 55 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 56 | 57 | ### 2. Warning 58 | 59 | **Community Impact**: A violation through a single incident or series of actions. 60 | 61 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 62 | 63 | ### 3. Temporary Ban 64 | 65 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 66 | 67 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 68 | 69 | ### 4. Permanent Ban 70 | 71 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 72 | 73 | **Consequence**: A permanent ban from any sort of public interaction within the community. 74 | 75 | ## Attribution 76 | 77 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 78 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 79 | 80 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 81 | 82 | [homepage]: https://www.contributor-covenant.org 83 | 84 | For answers to common questions about this code of conduct, see the FAQ at 85 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 86 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for your interest. Contributions are welcome! 4 | 5 | > Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. 6 | 7 | Check the [Issues](https://github.com/olets/zsh-window-title/issues) to see if your topic has been discussed before or if it is being worked on. You may also want to check the roadmap (see above). Discussing in an Issue before opening a Pull Request means future contributors only have to search in one place. 8 | 9 | This project uses EditorConfig to maintain consistent coding style. Please ensure that contributions conform to its configuration. The easiest way is to let EditorConfig take care of it for you. See https://editorconfig.org/ for details on how to use EditorConfig with various popular text editors. 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | zsh-window-title Copyright (2021) (Henry Bley-Vroman)(“Licensor”) 2 | 3 | Lay summary: This license requires that reusers give credit to the 4 | creator. It allows reusers to distribute, remix, adapt, and build 5 | upon the material in any medium or format, for noncommercial purposes 6 | only. If others modify or adapt the material, they must license the 7 | modified material under identical terms. This license prohibits the 8 | use of software to violate universal standards of human rights. 9 | 10 | This license brings together CC BY-NC-SA 4.0 and the Hippocratic 11 | License. The Hippocratic License clause follows the form of the 12 | "Commons Clause" License Condition v1.0 13 | (https://commonsclause.com/). The combination was not put together 14 | by a lawyer; it should be read in the spirit of the conversation at 15 | https://github.com/EthicalSource/hippocratic-license/issues/56. 16 | 17 | Commercial use is disallowed but commercial code but the possibility 18 | of an agreement being reached whereby the code is used commercially 19 | is not ruled out. Any such agreement must be reached with its original 20 | creator and Licensor, Henry Bley-Vroman. 21 | 22 | --- 23 | 24 | The Software is provided to you by the Licensor under the License, 25 | as defined below, subject to the following condition which comes from 26 | Hippocratic License Version Number: 2.1: 27 | 28 | * Compliance with Human Rights Principles and Human Rights Laws. 29 | 30 | 1. Human Rights Principles. 31 | 32 | (a) Licensee is advised to consult the articles of the United 33 | Nations Universal Declaration of Human Rights and the United 34 | Nations Global Compact that define recognized principles of 35 | international human rights (the “Human Rights Principles”). 36 | Licensee shall use the Software in a manner consistent with 37 | Human Rights Principles. 38 | 39 | (b) Unless the Licensor and Licensee agree otherwise, any 40 | dispute, controversy, or claim arising out of or relating to 41 | (i) Section 1(a) regarding Human Rights Principles, including 42 | the breach of Section 1(a), termination of this License for 43 | breach of the Human Rights Principles, or invalidity of Section 44 | 1(a) or (ii) a determination of whether any Law is consistent 45 | or in conflict with Human Rights Principles pursuant to Section 46 | 2, below, shall be settled by arbitration in accordance with 47 | the Hague Rules on Business and Human Rights Arbitration (the 48 | “Rules”); provided, however, that Licensee may elect not to 49 | participate in such arbitration, in which event this License 50 | (and all rights licensed hereunder) shall end immediately. The 51 | number of arbitrators shall be one unless the Rules require 52 | otherwise. 53 | 54 | Unless both the Licensor and Licensee agree to the contrary: 55 | (1) All documents and information concerning the arbitration 56 | shall be public and may be disclosed by any party; (2) The 57 | repository referred to under Article 43 of the Rules shall make 58 | available to the public in a timely manner all documents 59 | concerning the arbitration which are communicated to it, 60 | including all submissions of the parties, all evidence admitted 61 | into the record of the proceedings, all transcripts or other 62 | recordings of hearings and all orders, decisions and awards of 63 | the arbitral tribunal, subject only to the arbitral tribunal's 64 | powers to take such measures as may be necessary to safeguard 65 | the integrity of the arbitral process pursuant to Articles 18, 66 | 33, 41 and 42 of the Rules; and (3) Article 26(6) of the Rules 67 | shall not apply. 68 | 69 | 2. Human Rights Laws. The Software shall not be used by any person 70 | or entity for any systems, activities, or other uses that violate 71 | any Human Rights Laws. “Human Rights Laws” means any applicable 72 | laws, regulations, or rules (collectively, “Laws”) that protect 73 | human, civil, labor, privacy, political, environmental, security, 74 | economic, due process, or similar rights; provided, however, that 75 | such Laws are consistent and not in conflict with Human Rights 76 | Principles (a dispute over the consistency or a conflict between 77 | Laws and Human Rights Principles shall be determined by arbitration 78 | as stated above). Where the Human Rights Laws of more than one 79 | jurisdiction are applicable or in conflict with respect to the use 80 | of the Software, the Human Rights Laws that are most protective of 81 | the individuals or groups harmed shall apply. 82 | 83 | 3. Indemnity. Licensee shall hold harmless and indemnify Licensor 84 | (and any other contributor) against all losses, damages, 85 | liabilities, deficiencies, claims, actions, judgments, settlements, 86 | interest, awards, penalties, fines, costs, or expenses of whatever 87 | kind, including Licensor’s reasonable attorneys’ fees, arising out 88 | of or relating to Licensee’s use of the Software in violation of 89 | Human Rights Laws or Human Rights Principles. 90 | 91 | 92 | Attribution-NonCommercial-ShareAlike 4.0 International 93 | 94 | ======================================================================= 95 | 96 | Creative Commons Corporation ("Creative Commons") is not a law firm and 97 | does not provide legal services or legal advice. Distribution of 98 | Creative Commons public licenses does not create a lawyer-client or 99 | other relationship. Creative Commons makes its licenses and related 100 | information available on an "as-is" basis. Creative Commons gives no 101 | warranties regarding its licenses, any material licensed under their 102 | terms and conditions, or any related information. Creative Commons 103 | disclaims all liability for damages resulting from their use to the 104 | fullest extent possible. 105 | 106 | Using Creative Commons Public Licenses 107 | 108 | Creative Commons public licenses provide a standard set of terms and 109 | conditions that creators and other rights holders may use to share 110 | original works of authorship and other material subject to copyright 111 | and certain other rights specified in the public license below. The 112 | following considerations are for informational purposes only, are not 113 | exhaustive, and do not form part of our licenses. 114 | 115 | Considerations for licensors: Our public licenses are 116 | intended for use by those authorized to give the public 117 | permission to use material in ways otherwise restricted by 118 | copyright and certain other rights. Our licenses are 119 | irrevocable. Licensors should read and understand the terms 120 | and conditions of the license they choose before applying it. 121 | Licensors should also secure all rights necessary before 122 | applying our licenses so that the public can reuse the 123 | material as expected. Licensors should clearly mark any 124 | material not subject to the license. This includes other CC- 125 | licensed material, or material used under an exception or 126 | limitation to copyright. More considerations for licensors: 127 | wiki.creativecommons.org/Considerations_for_licensors 128 | 129 | Considerations for the public: By using one of our public 130 | licenses, a licensor grants the public permission to use the 131 | licensed material under specified terms and conditions. If 132 | the licensor's permission is not necessary for any reason--for 133 | example, because of any applicable exception or limitation to 134 | copyright--then that use is not regulated by the license. Our 135 | licenses grant only permissions under copyright and certain 136 | other rights that a licensor has authority to grant. Use of 137 | the licensed material may still be restricted for other 138 | reasons, including because others have copyright or other 139 | rights in the material. A licensor may make special requests, 140 | such as asking that all changes be marked or described. 141 | Although not required by our licenses, you are encouraged to 142 | respect those requests where reasonable. More considerations 143 | for the public: 144 | wiki.creativecommons.org/Considerations_for_licensees 145 | 146 | ======================================================================= 147 | 148 | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International 149 | Public License 150 | 151 | By exercising the Licensed Rights (defined below), You accept and agree 152 | to be bound by the terms and conditions of this Creative Commons 153 | Attribution-NonCommercial-ShareAlike 4.0 International Public License 154 | ("Public License"). To the extent this Public License may be 155 | interpreted as a contract, You are granted the Licensed Rights in 156 | consideration of Your acceptance of these terms and conditions, and the 157 | Licensor grants You such rights in consideration of benefits the 158 | Licensor receives from making the Licensed Material available under 159 | these terms and conditions. 160 | 161 | 162 | Section 1 -- Definitions. 163 | 164 | a. Adapted Material means material subject to Copyright and Similar 165 | Rights that is derived from or based upon the Licensed Material 166 | and in which the Licensed Material is translated, altered, 167 | arranged, transformed, or otherwise modified in a manner requiring 168 | permission under the Copyright and Similar Rights held by the 169 | Licensor. For purposes of this Public License, where the Licensed 170 | Material is a musical work, performance, or sound recording, 171 | Adapted Material is always produced where the Licensed Material is 172 | synched in timed relation with a moving image. 173 | 174 | b. Adapter's License means the license You apply to Your Copyright 175 | and Similar Rights in Your contributions to Adapted Material in 176 | accordance with the terms and conditions of this Public License. 177 | 178 | c. BY-NC-SA Compatible License means a license listed at 179 | creativecommons.org/compatiblelicenses, approved by Creative 180 | Commons as essentially the equivalent of this Public License. 181 | 182 | d. Copyright and Similar Rights means copyright and/or similar rights 183 | closely related to copyright including, without limitation, 184 | performance, broadcast, sound recording, and Sui Generis Database 185 | Rights, without regard to how the rights are labeled or 186 | categorized. For purposes of this Public License, the rights 187 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 188 | Rights. 189 | 190 | e. Effective Technological Measures means those measures that, in the 191 | absence of proper authority, may not be circumvented under laws 192 | fulfilling obligations under Article 11 of the WIPO Copyright 193 | Treaty adopted on December 20, 1996, and/or similar international 194 | agreements. 195 | 196 | f. Exceptions and Limitations means fair use, fair dealing, and/or 197 | any other exception or limitation to Copyright and Similar Rights 198 | that applies to Your use of the Licensed Material. 199 | 200 | g. License Elements means the license attributes listed in the name 201 | of a Creative Commons Public License. The License Elements of this 202 | Public License are Attribution, NonCommercial, and ShareAlike. 203 | 204 | h. Licensed Material means the artistic or literary work, database, 205 | or other material to which the Licensor applied this Public 206 | License. 207 | 208 | i. Licensed Rights means the rights granted to You subject to the 209 | terms and conditions of this Public License, which are limited to 210 | all Copyright and Similar Rights that apply to Your use of the 211 | Licensed Material and that the Licensor has authority to license. 212 | 213 | j. Licensor means the individual(s) or entity(ies) granting rights 214 | under this Public License. 215 | 216 | k. NonCommercial means not primarily intended for or directed towards 217 | commercial advantage or monetary compensation. For purposes of 218 | this Public License, the exchange of the Licensed Material for 219 | other material subject to Copyright and Similar Rights by digital 220 | file-sharing or similar means is NonCommercial provided there is 221 | no payment of monetary compensation in connection with the 222 | exchange. 223 | 224 | l. Share means to provide material to the public by any means or 225 | process that requires permission under the Licensed Rights, such 226 | as reproduction, public display, public performance, distribution, 227 | dissemination, communication, or importation, and to make material 228 | available to the public including in ways that members of the 229 | public may access the material from a place and at a time 230 | individually chosen by them. 231 | 232 | m. Sui Generis Database Rights means rights other than copyright 233 | resulting from Directive 96/9/EC of the European Parliament and of 234 | the Council of 11 March 1996 on the legal protection of databases, 235 | as amended and/or succeeded, as well as other essentially 236 | equivalent rights anywhere in the world. 237 | 238 | n. You means the individual or entity exercising the Licensed Rights 239 | under this Public License. Your has a corresponding meaning. 240 | 241 | 242 | Section 2 -- Scope. 243 | 244 | a. License grant. 245 | 246 | 1. Subject to the terms and conditions of this Public License, 247 | the Licensor hereby grants You a worldwide, royalty-free, 248 | non-sublicensable, non-exclusive, irrevocable license to 249 | exercise the Licensed Rights in the Licensed Material to: 250 | 251 | a. reproduce and Share the Licensed Material, in whole or 252 | in part, for NonCommercial purposes only; and 253 | 254 | b. produce, reproduce, and Share Adapted Material for 255 | NonCommercial purposes only. 256 | 257 | 2. Exceptions and Limitations. For the avoidance of doubt, where 258 | Exceptions and Limitations apply to Your use, this Public 259 | License does not apply, and You do not need to comply with 260 | its terms and conditions. 261 | 262 | 3. Term. The term of this Public License is specified in Section 263 | 6(a). 264 | 265 | 4. Media and formats; technical modifications allowed. The 266 | Licensor authorizes You to exercise the Licensed Rights in 267 | all media and formats whether now known or hereafter created, 268 | and to make technical modifications necessary to do so. The 269 | Licensor waives and/or agrees not to assert any right or 270 | authority to forbid You from making technical modifications 271 | necessary to exercise the Licensed Rights, including 272 | technical modifications necessary to circumvent Effective 273 | Technological Measures. For purposes of this Public License, 274 | simply making modifications authorized by this Section 2(a) 275 | (4) never produces Adapted Material. 276 | 277 | 5. Downstream recipients. 278 | 279 | a. Offer from the Licensor -- Licensed Material. Every 280 | recipient of the Licensed Material automatically 281 | receives an offer from the Licensor to exercise the 282 | Licensed Rights under the terms and conditions of this 283 | Public License. 284 | 285 | b. Additional offer from the Licensor -- Adapted Material. 286 | Every recipient of Adapted Material from You 287 | automatically receives an offer from the Licensor to 288 | exercise the Licensed Rights in the Adapted Material 289 | under the conditions of the Adapter's License You apply. 290 | 291 | c. No downstream restrictions. You may not offer or impose 292 | any additional or different terms or conditions on, or 293 | apply any Effective Technological Measures to, the 294 | Licensed Material if doing so restricts exercise of the 295 | Licensed Rights by any recipient of the Licensed 296 | Material. 297 | 298 | 6. No endorsement. Nothing in this Public License constitutes or 299 | may be construed as permission to assert or imply that You 300 | are, or that Your use of the Licensed Material is, connected 301 | with, or sponsored, endorsed, or granted official status by, 302 | the Licensor or others designated to receive attribution as 303 | provided in Section 3(a)(1)(A)(i). 304 | 305 | b. Other rights. 306 | 307 | 1. Moral rights, such as the right of integrity, are not 308 | licensed under this Public License, nor are publicity, 309 | privacy, and/or other similar personality rights; however, to 310 | the extent possible, the Licensor waives and/or agrees not to 311 | assert any such rights held by the Licensor to the limited 312 | extent necessary to allow You to exercise the Licensed 313 | Rights, but not otherwise. 314 | 315 | 2. Patent and trademark rights are not licensed under this 316 | Public License. 317 | 318 | 3. To the extent possible, the Licensor waives any right to 319 | collect royalties from You for the exercise of the Licensed 320 | Rights, whether directly or through a collecting society 321 | under any voluntary or waivable statutory or compulsory 322 | licensing scheme. In all other cases the Licensor expressly 323 | reserves any right to collect such royalties, including when 324 | the Licensed Material is used other than for NonCommercial 325 | purposes. 326 | 327 | 328 | Section 3 -- License Conditions. 329 | 330 | Your exercise of the Licensed Rights is expressly made subject to the 331 | following conditions. 332 | 333 | a. Attribution. 334 | 335 | 1. If You Share the Licensed Material (including in modified 336 | form), You must: 337 | 338 | a. retain the following if it is supplied by the Licensor 339 | with the Licensed Material: 340 | 341 | i. identification of the creator(s) of the Licensed 342 | Material and any others designated to receive 343 | attribution, in any reasonable manner requested by 344 | the Licensor (including by pseudonym if 345 | designated); 346 | 347 | ii. a copyright notice; 348 | 349 | iii. a notice that refers to this Public License; 350 | 351 | iv. a notice that refers to the disclaimer of 352 | warranties; 353 | 354 | v. a URI or hyperlink to the Licensed Material to the 355 | extent reasonably practicable; 356 | 357 | b. indicate if You modified the Licensed Material and 358 | retain an indication of any previous modifications; and 359 | 360 | c. indicate the Licensed Material is licensed under this 361 | Public License, and include the text of, or the URI or 362 | hyperlink to, this Public License. 363 | 364 | 2. You may satisfy the conditions in Section 3(a)(1) in any 365 | reasonable manner based on the medium, means, and context in 366 | which You Share the Licensed Material. For example, it may be 367 | reasonable to satisfy the conditions by providing a URI or 368 | hyperlink to a resource that includes the required 369 | information. 370 | 3. If requested by the Licensor, You must remove any of the 371 | information required by Section 3(a)(1)(A) to the extent 372 | reasonably practicable. 373 | 374 | b. ShareAlike. 375 | 376 | In addition to the conditions in Section 3(a), if You Share 377 | Adapted Material You produce, the following conditions also apply. 378 | 379 | 1. The Adapter's License You apply must be a Creative Commons 380 | license with the same License Elements, this version or 381 | later, or a BY-NC-SA Compatible License. 382 | 383 | 2. You must include the text of, or the URI or hyperlink to, the 384 | Adapter's License You apply. You may satisfy this condition 385 | in any reasonable manner based on the medium, means, and 386 | context in which You Share Adapted Material. 387 | 388 | 3. You may not offer or impose any additional or different terms 389 | or conditions on, or apply any Effective Technological 390 | Measures to, Adapted Material that restrict exercise of the 391 | rights granted under the Adapter's License You apply. 392 | 393 | 394 | Section 4 -- Sui Generis Database Rights. 395 | 396 | Where the Licensed Rights include Sui Generis Database Rights that 397 | apply to Your use of the Licensed Material: 398 | 399 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 400 | to extract, reuse, reproduce, and Share all or a substantial 401 | portion of the contents of the database for NonCommercial purposes 402 | only; 403 | 404 | b. if You include all or a substantial portion of the database 405 | contents in a database in which You have Sui Generis Database 406 | Rights, then the database in which You have Sui Generis Database 407 | Rights (but not its individual contents) is Adapted Material, 408 | including for purposes of Section 3(b); and 409 | 410 | c. You must comply with the conditions in Section 3(a) if You Share 411 | all or a substantial portion of the contents of the database. 412 | 413 | For the avoidance of doubt, this Section 4 supplements and does not 414 | replace Your obligations under this Public License where the Licensed 415 | Rights include other Copyright and Similar Rights. 416 | 417 | 418 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 419 | 420 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 421 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 422 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 423 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 424 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 425 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 426 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 427 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 428 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 429 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 430 | 431 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 432 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 433 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 434 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 435 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 436 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 437 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 438 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 439 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 440 | 441 | c. The disclaimer of warranties and limitation of liability provided 442 | above shall be interpreted in a manner that, to the extent 443 | possible, most closely approximates an absolute disclaimer and 444 | waiver of all liability. 445 | 446 | 447 | Section 6 -- Term and Termination. 448 | 449 | a. This Public License applies for the term of the Copyright and 450 | Similar Rights licensed here. However, if You fail to comply with 451 | this Public License, then Your rights under this Public License 452 | terminate automatically. 453 | 454 | b. Where Your right to use the Licensed Material has terminated under 455 | Section 6(a), it reinstates: 456 | 457 | 1. automatically as of the date the violation is cured, provided 458 | it is cured within 30 days of Your discovery of the 459 | violation; or 460 | 461 | 2. upon express reinstatement by the Licensor. 462 | 463 | For the avoidance of doubt, this Section 6(b) does not affect any 464 | right the Licensor may have to seek remedies for Your violations 465 | of this Public License. 466 | 467 | c. For the avoidance of doubt, the Licensor may also offer the 468 | Licensed Material under separate terms or conditions or stop 469 | distributing the Licensed Material at any time; however, doing so 470 | will not terminate this Public License. 471 | 472 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 473 | License. 474 | 475 | 476 | Section 7 -- Other Terms and Conditions. 477 | 478 | a. The Licensor shall not be bound by any additional or different 479 | terms or conditions communicated by You unless expressly agreed. 480 | 481 | b. Any arrangements, understandings, or agreements regarding the 482 | Licensed Material not stated herein are separate from and 483 | independent of the terms and conditions of this Public License. 484 | 485 | 486 | Section 8 -- Interpretation. 487 | 488 | a. For the avoidance of doubt, this Public License does not, and 489 | shall not be interpreted to, reduce, limit, restrict, or impose 490 | conditions on any use of the Licensed Material that could lawfully 491 | be made without permission under this Public License. 492 | 493 | b. To the extent possible, if any provision of this Public License is 494 | deemed unenforceable, it shall be automatically reformed to the 495 | minimum extent necessary to make it enforceable. If the provision 496 | cannot be reformed, it shall be severed from this Public License 497 | without affecting the enforceability of the remaining terms and 498 | conditions. 499 | 500 | c. No term or condition of this Public License will be waived and no 501 | failure to comply consented to unless expressly agreed to by the 502 | Licensor. 503 | 504 | d. Nothing in this Public License constitutes or may be interpreted 505 | as a limitation upon, or waiver of, any privileges and immunities 506 | that apply to the Licensor or You, including from the legal 507 | processes of any jurisdiction or authority. 508 | 509 | ======================================================================= 510 | 511 | Creative Commons is not a party to its public 512 | licenses. Notwithstanding, Creative Commons may elect to apply one of 513 | its public licenses to material it publishes and in those instances 514 | will be considered the “Licensor.” The text of the Creative Commons 515 | public licenses is dedicated to the public domain under the CC0 Public 516 | Domain Dedication. Except for the limited purpose of indicating that 517 | material is shared under a Creative Commons public license or as 518 | otherwise permitted by the Creative Commons policies published at 519 | creativecommons.org/policies, Creative Commons does not authorize the 520 | use of the trademark "Creative Commons" or any other trademark or logo 521 | of Creative Commons without its prior written consent including, 522 | without limitation, in connection with any unauthorized modifications 523 | to any of its public licenses or any other arrangements, 524 | understandings, or agreements concerning use of licensed material. For 525 | the avoidance of doubt, this paragraph does not form part of the 526 | public licenses. 527 | 528 | Creative Commons may be contacted at creativecommons.org. 529 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zsh-window-title ![GitHub release (latest by date)](https://img.shields.io/github/v/release/olets/zsh-window-title) 2 | 3 | > A zsh plugin for informative terminal window titles 4 | 5 | 6 | - [Requirements](#requirements) 7 | - [Installation](#installation) 8 | - [Homebrew](#homebrew) 9 | - [With a shell plugin manager](#with-a-shell-plugin-manager) 10 | - [Manual](#manual) 11 | - [Usage](#usage) 12 | - [macOS Terminal.app users](#macos-terminalapp-users) 13 | - [Oh-My-Zsh users](#oh-my-zsh-users) 14 | - [CLI](#cli) 15 | - [Options](#options) 16 | - [Changelog](#changelog) 17 | - [Roadmap](#roadmap) 18 | - [Contributing](#contributing) 19 | - [License](#License) 20 | 21 | ## Requirements 22 | 23 | - Zsh 24 | 25 | ## Installation 26 | 27 | ### Homebrew 28 | 29 | ```shell 30 | brew install olets/tap/zsh-window-title 31 | ``` 32 | 33 | ### With a shell plugin manager 34 | 35 | 1. Install zsh-window-title with a zsh plugin manager. Each has their own way of doing things. See your package manager's documentation or the [zsh plugin manager plugin installation procedures gist](https://gist.github.com/olets/06009589d7887617e061481e22cf5a4a). 36 | 37 | After adding the plugin to the manager, restart zsh: 38 | 39 | ```shell 40 | exec zsh 41 | ``` 42 | 43 | ### Manual 44 | 45 | 1. Download [the latest `zsh-window-title` binary](https://github.com/olets/zsh-window-title/releases/latest) 46 | 1. Either 47 | - Put the file `zsh-window-title` in a directory in your `PATH` and add `source zsh-window-title` to your `~/.zshrc` file 48 | - Add `source the/path/to/zsh-window-title` to your `~/.zshrc` file 49 | 1. Restart zsh: 50 | ```shell 51 | exec zsh 52 | ``` 53 | 54 | ## Usage 55 | 56 | Once zsh-window-title is installed, your terminal window title will be 57 | 58 | - `/` when nothing's running 59 | - `/ - ` when something's running 60 | - `/ - ` when something's running and the first word of the last run command is one of the configured prefixes. 61 | 62 | For example, after running `sleep 2` in the directory `~/olets/zsh-window-title`, the window title will be `olets/zsh-window-title - sleep`. After running `sudo sleep 2`, it will be `olets/zsh-window-title - sudo sleep`. 63 | 64 | Note that the command is not parsed. If you run `echo hello world && sleep 10`, the window title will show `echo` for the duration, not `echo` for a moment and then `sleep`. 65 | 66 | The number of path segments to show is configurable, and so are the prefixes. See [Options](#options). 67 | 68 | ### macOS Terminal.app users 69 | 70 | By default macOS's Terminal app will control the window title. Disable that by: 71 | 72 | > Preferences > Profiles > Window > Title --> uncheck everything. 73 | 74 | ### Oh-My-Zsh users 75 | 76 | By default OMZ will control the terminal window title. Disable that by adding 77 | 78 | ```shell 79 | DISABLE_AUTO_TITLE=”true” 80 | ``` 81 | 82 | to your `~/.zshrc` file. 83 | 84 | ### CLI 85 | 86 | ```shell 87 | zwt restore-defaults 88 | (help | --help | -h) 89 | (version | --version | -v) 90 | ``` 91 | 92 | - `zwt restore-defaults` Restore options to their defaults in the current session. See [Options](#options). 93 | - `zwt (help | --help | -h)` Show the manpage. 94 | - `zwt (version | --version | -v)` Print the command name and version. 95 | 96 | ## Options 97 | 98 | Variable | Type | Default | Use 99 | ---|---|---|--- 100 | ZSH_WINDOW_TITLE_COMMAND_PREFIXES | array | `( sudo )` | If the command starts with one of these terms, show it and the following word. (With the default, running `sudo sleep 10` will add `sudo sleep` to the window title.) 101 | ZSH_WINDOW_TITLE_DEBUG | integer | `0` | If non-zero, print hook debugging messages 102 | ZSH_WINDOW_TITLE_DIRECTORY_DEPTH | integer | `2` | How many directory levels to display 103 | ZWT_DEBUG | integer | `0` | If non-zero, print CLI debugging messages 104 | 105 | ## Changelog 106 | 107 | See the [CHANGELOG](CHANGELOG.md) file. 108 | 109 | ## Roadmap 110 | 111 | See the [ROADMAP](ROADMAP.md) file. 112 | 113 | ## Contributing 114 | 115 | Thanks for your interest. Contributions are welcome! 116 | 117 | > Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. 118 | 119 | Check the [Issues](https://github.com/olets/zsh-window-title/issues) to see if your topic has been discussed before or if it is being worked on. 120 | 121 | Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. 122 | 123 | ## License 124 | 125 |

zsh-window-title by Henry Bley-Vroman is licensed under CC BY-NC-SA 4.0 with a human rights condition from Hippocratic License 2.1. Persons interested in using or adapting this work for commercial purposes should contact the author.

126 | 127 | Licensed under Creative CommonsLicensed with an attribution termLicensed with a non-commercial termLicensed with a share-alike term 128 | 129 | For the full text of the license, see the [LICENSE](LICENSE) file. 130 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | ## Done, not yet released 4 | 5 | - [x] Fix debugging 6 | 7 | ## Next 8 | 9 | -------------------------------------------------------------------------------- /git-replay.yaml: -------------------------------------------------------------------------------- 1 | rebase: 2 | main: 3 | - next 4 | - async-duration 5 | - sync-duration 6 | -------------------------------------------------------------------------------- /man/man1/zwt.1: -------------------------------------------------------------------------------- 1 | .TH "ZWT" 1 "May 23 2024" "zwt 1.2.0" "User Commands" 2 | .SH NAME 3 | zwt \- zsh-window-title CLI 4 | 5 | .SH SYNOPSIS 6 | 7 | \fBzwt restore-defaults\fR 8 | 9 | .SH DESCRIPTION 10 | 11 | \fBzwt\fR is the CLI for managing the zsh plugin \fBzsh-window-title\fR. 12 | 13 | .SH Commands 14 | 15 | .IP \(bu 16 | \fBrestore-defaults\fR 17 | 18 | Restore options to their defaults. 19 | 20 | .IP \(bu 21 | \fBhelp\fR or \fB\-\-help\fR or \fB\-h\fR 22 | 23 | Show the manpage. 24 | 25 | .IP \(bu 26 | \fBversion\fR or \fB\-\-version\fR or \fB\-v\fR 27 | 28 | Print the command name and current version. 29 | 30 | .SH Configuration 31 | The following variables may be set: 32 | 33 | .IP \(bu 34 | \fIZSH_WINDOW_TITLE_COMMAND_PREFIXES\fR 35 | If the command starts with one of these terms, show it and the following word. 36 | With the default, running `sudo sleep 10` will add `sudo sleep` 37 | to the window title. (array; default `( sudo )`) 38 | 39 | .IP \(bu 40 | \fIZSH_WINDOW_TITLE_DEBUG\fR 41 | If non-zero, print hook debugging messages (integer; default `0`) 42 | 43 | .IP \(bu 44 | \fIZSH_WINDOW_TITLE_DIRECTORY_DEPTH\fR 45 | How many directory levels to display (integer; default `2`) 46 | 47 | .IP \(bu 48 | \fIZWT_DEBUG\fR 49 | If non-zero, print CLI debugging messages (integer; default `0`) 50 | 51 | .\" .SH EXAMPLES 52 | 53 | .SH LICENSE 54 | 55 | Licensed under CC BY-NC-SA 4.0 with a human rights condition from Hippocratic 56 | License 2.1. See the LICENSE file for details. Persons interested in using or 57 | adapting this work for commercial purposes should contact the author. 58 | 59 | .SH HOMEPAGE 60 | 61 | Explanations and examples can be found at https://github.com/olets/zsh-window-title 62 | 63 | .SH AUTHORS 64 | 65 | Henry Bley\-Vroman 66 | -------------------------------------------------------------------------------- /zsh-window-title.plugin.zsh: -------------------------------------------------------------------------------- 1 | source ${0:A:h}/zsh-window-title.zsh 2 | -------------------------------------------------------------------------------- /zsh-window-title.zsh: -------------------------------------------------------------------------------- 1 | # zsh-window-title 2 | # https://github.com/olets/zsh-window-title 3 | # A zsh plugin for informative terminal window titles 4 | # Copyright © 2021-present Henry Bley-Vroman 5 | 6 | 'builtin' 'typeset' -g __zwt_dir && \ 7 | __zwt_dir=${0:A:h} 8 | 9 | 'builtin' 'typeset' -g +r ZWT_VERSION >/dev/null && \ 10 | ZWT_VERSION=1.2.0 && \ 11 | 'builtin' 'typeset' -gr ZWT_VERSION 12 | 13 | 'builtin' 'typeset' -ga +r __zsh_window_title_command_prefixes >/dev/null && \ 14 | __zsh_window_title_command_prefixes=( sudo ) && \ 15 | 'builtin' 'typeset' -gar __zsh_window_title_command_prefixes 16 | 17 | 'builtin' 'typeset' -gi +r __zsh_window_title_debug_default >/dev/null && \ 18 | __zsh_window_title_debug_default=0 && \ 19 | 'builtin' 'typeset' -gir __zsh_window_title_debug_default 20 | 21 | 'builtin' 'typeset' -gi +r __zsh_window_title_directory_depth_default >/dev/null && \ 22 | __zsh_window_title_directory_depth_default=2 && \ 23 | 'builtin' 'typeset' -gir __zsh_window_title_directory_depth_default 24 | 25 | 'builtin' 'typeset' -gi +r __zwt_debug_default >/dev/null && \ 26 | __zwt_debug_default=0 && \ 27 | 'builtin' 'typeset' -gir __zwt_debug_default 28 | 29 | 30 | # zwt CLI subcommands 31 | 32 | __zwt:debugger() { 33 | 'builtin' 'emulate' -LR zsh 34 | 35 | (( ZWT_DEBUG )) && 'builtin' 'print' $funcstack[2] 36 | } 37 | 38 | __zwt:help() { 39 | 'builtin' 'emulate' -LR zsh 40 | __zwt:debugger 41 | 42 | 'command' 'man' zwt 2>/dev/null || 'command' 'man' $__zwt_dir/man/man1/zwt.1 43 | } 44 | 45 | __zwt:restore-defaults() { 46 | 'builtin' 'emulate' -LR zsh 47 | __zwt:debugger 48 | 49 | ZSH_WINDOW_TITLE_COMMAND_PREFIXES=$__zsh_window_title_command_prefixes 50 | ZSH_WINDOW_TITLE_DEBUG=$__zsh_window_title_debug_default 51 | ZSH_WINDOW_TITLE_DIRECTORY_DEPTH=$__zsh_window_title_directory_depth_default 52 | ZWT_DEBUG=$__zwt_debug_default 53 | } 54 | 55 | __zwt:version() { 56 | 'builtin' 'emulate' -LR zsh 57 | __zwt:debugger 58 | 59 | 'builtin' 'print' zwt $ZWT_VERSION 60 | } 61 | 62 | 63 | # zsh-window-title subcommands 64 | 65 | __zsh-window-title:debugger() { 66 | 'builtin' 'emulate' -LR zsh 67 | 68 | (( ZSH_WINDOW_TITLE_DEBUG )) && 'builtin' 'print' $funcstack[2] 69 | } 70 | 71 | __zsh-window-title:add-hooks() { 72 | 'builtin' 'emulate' -LR zsh 73 | __zsh-window-title:debugger 74 | 75 | # update window title before drawing the prompt 76 | add-zsh-hook precmd __zsh-window-title:precmd 77 | 78 | # update the window title before executing a command 79 | add-zsh-hook preexec __zsh-window-title:preexec 80 | } 81 | 82 | __zsh-window-title:get_dir() { 83 | 'builtin' 'emulate' -LR zsh 84 | __zsh-window-title:debugger 85 | 86 | echo ${(%):-%$ZSH_WINDOW_TITLE_DIRECTORY_DEPTH~} 87 | } 88 | 89 | __zsh-window-title:init() { 90 | 'builtin' 'emulate' -LR zsh 91 | 92 | 'builtin' 'typeset' -gi ZWT_DEBUG=${ZWT_DEBUG:-$__zwt_debug_default} 93 | 94 | 'builtin' 'typeset' -gi ZSH_WINDOW_TITLE_DEBUG=${ZSH_WINDOW_TITLE_DEBUG:-$__zsh_window_title_debug_default} 95 | 96 | __zsh-window-title:debugger 97 | 98 | [[ ${(t)ZSH_WINDOW_TITLE_COMMAND_PREFIXES} != array ]] && \ 99 | ZSH_WINDOW_TITLE_COMMAND_PREFIXES=( $__zsh_window_title_command_prefixes ) 100 | 'builtin' 'typeset' -ga ZSH_WINDOW_TITLE_COMMAND_PREFIXES 101 | 102 | 'builtin' 'typeset' -gi ZSH_WINDOW_TITLE_DIRECTORY_DEPTH=${ZSH_WINDOW_TITLE_DIRECTORY_DEPTH:-$__zsh_window_title_directory_depth_default} 103 | 104 | __zsh-window-title:precmd 105 | 106 | 'builtin' 'autoload' -U add-zsh-hook 107 | 108 | __zsh-window-title:add-hooks 109 | } 110 | 111 | __zsh-window-title:set-title() { 112 | case $TERM in 113 | screen*|\ 114 | tmux*) 115 | 'builtin' 'echo' -ne "\033k$*\033\\" 116 | ;; 117 | *) 118 | 'builtin' 'echo' -ne "\033]0;$*\007" 119 | ;; 120 | esac 121 | } 122 | 123 | __zsh-window-title:precmd() { 124 | 'builtin' 'emulate' -LR zsh 125 | __zsh-window-title:debugger 126 | 127 | __zsh-window-title:set-title $(__zsh-window-title:get_dir) 128 | } 129 | 130 | __zsh-window-title:preexec() { 131 | 'builtin' 'emulate' -LR zsh 132 | __zsh-window-title:debugger 133 | 134 | local cmd=${1[(w)1]} 135 | local -i is_prefixed=$ZSH_WINDOW_TITLE_COMMAND_PREFIXES[(Ie)$cmd] 2>/dev/null 136 | local second_word=${1[(w)2]} 137 | 138 | (( is_prefixed )) && \ 139 | [[ -n $second_word ]] && \ 140 | cmd+=" $second_word" 141 | 142 | __zsh-window-title:set-title $(__zsh-window-title:get_dir) - $cmd 143 | } 144 | 145 | zwt() { 146 | 'builtin' 'emulate' -LR zsh 147 | __zwt:debugger 148 | 149 | while (($# )); do 150 | case $1 in 151 | "--help"|\ 152 | "-h"|\ 153 | "help") 154 | __zwt:help 155 | return 156 | ;; 157 | "restore-defaults") 158 | __zwt:restore-defaults 159 | return 160 | ;; 161 | "--version"|\ 162 | "-v"|\ 163 | "version") 164 | __zwt:version 165 | return 166 | ;; 167 | *) 168 | shift 169 | ;; 170 | esac 171 | done 172 | } 173 | 174 | __zsh-window-title:init 175 | --------------------------------------------------------------------------------