sindresorhus / pure

Pretty, minimal and fast ZSH prompt
MIT License
13.12k stars 971 forks source link

Feature request: customise terminal title format #656

Open benjamineskola opened 1 year ago

benjamineskola commented 1 year ago

Currently the title format is hardcoded in two calls to prompt_pure_set_title(). This means that if I want to change the format of the title, I have to entirely override that function and then add hooks of my own to set the title with the appropriate ANSI codes. That's both more complicated than it needs to be and inherently fragile, since it assumes that the function name will never change.

I have two (complementary) suggestions:

  1. Add a variable to disable prompt setting, wrapping around the two calls to prompt_pure_set_title(). Default to leaving it enabled but allow the user to switch it off and manage the prompt on their own if they wish.
  2. Add variables that determine the contents of the prompt, using the current values as defaults: ${PURE_PROMPT_TITLE_IDLE:-%~} or something along those lines. That way the user can override one or both of those as they wish.

I can try opening a PR if that's useful.

General information

System report (output of prompt_pure_system_report):