zed icon indicating copy to clipboard operation
zed copied to clipboard

Configure window title pattern

Open bglw opened this issue 1 year ago • 7 comments

Check for existing issues

  • [X] Completed

Describe the feature

Currently, Zed's windows titles take the form of {filename} — {project}, e.g. channel.rs — app.

I would like to configure this to be the inverse: {project} — {filename}, e.g. app — channel.rs.

I tend to have one window for each project, with multiple projects open at once. Having the project name prefix the filename ensures that in my window switcher, the project name is always visible even when the title is truncated.

As-is, I can wind up with situations like:

  • Cargo.toml — project_a
  • Cargo.toml — project_b
  • Cargo.toml — project_c

Truncated to:

  • Cargo.toml — pr...
  • Cargo.toml — pr...
  • Cargo.toml — pr...

Searching for this, I only turned up #5283 — which should possibly be closed as complete anyway since I am seeing details in the window title.

If applicable, add mockups / screenshots to help present your vision of the feature

Example of the situation I can currently find myself in when switching windows: (this is the full width of my switcher)

Screenshot 2024-07-16 at 4 06 55 PM

Vision of the feature: my prior VSCode setting:

  "window.title": "${rootName}${separator}${activeEditorShort}",

bglw avatar Jul 16 '24 04:07 bglw

(or as a quicker fix, even just an option to omit the filename and show only the project, which saves building any sort of template string parsing)

bglw avatar Jul 16 '24 04:07 bglw

I stumbled upon a problem when I want to find a Zed window, but I can't just search by Zed, because it's not there. As an example, a VSCodium window has its name in the title, maybe Zed should have it too:

wmctrl -l
0x04600003  0 nixos idea.log - log - VSCodium
0x00600003  4 nixos Alacritty
0x0180003d  0 nixos Configure window title pattern · Issue #14534 · zed-industries/zed — Mozilla Firefox
0x03a00003  0 nixos wmctrl -l
0x03c00002  0   N/A settings.json —            <- this is Zed

Overall having a configurable window title patter is a good idea IMO.

dmitryrn avatar Dec 01 '24 19:12 dmitryrn

For anyone who might wish to give this a go, the relevant code is fn update_window_title in crates/workspace/src/workspace.rs.

nt8r avatar Jan 29 '25 18:01 nt8r

Also, it would be nice to have a setting for workspace title, like what Intellij has, for example: The project is in ~/Projects/ums, the workspace title will be ums, and I want to set the workspace title to User Management Service.

MaMrEzO avatar Mar 04 '25 10:03 MaMrEzO

Same here. It would be nice to have a mechanism to set a title for a project. In my case, I have a project with manually added folders (monorepo, too many packages inside, and I only want a subset of those packages). Zed uses the name of the topmost folder in the list as the title, and this does not reflect the purpose of the project.

an2deg avatar May 09 '25 13:05 an2deg

I stumbled upon a problem when I want to find a Zed window, but I can't just search by Zed, because it's not there. As an example, a VSCodium window has its name in the title, maybe Zed should have it too:

Ran into this as well today. All the programs i have open have the program name in the title, Zed is the lone exception. Makes it a real pain to setup keyboard shortcuts to switch to the Zed window.

YMan84 avatar May 11 '25 23:05 YMan84

I'll open a PR hard-coding the — Zed clearly there's a need for it, it's a simpletitle.push_str(" — "); title.push_str(RELEASE_CHANNEL.display_name()), should should the collab / be before or after it? Imo it can even go after the project name instead of the edited file because it's logically per-project and it's more visible if the title gets cut-off

bbb651 avatar Jun 03 '25 19:06 bbb651