workspace: Add configurable window title formatting#54379
Open
jknlsn wants to merge 2 commits into
Open
Conversation
b758c25 to
97c3428
Compare
5035009 to
f110145
Compare
c81ecd1 to
ebad356
Compare
cbe240f to
9a0aefd
Compare
986c9b5 to
55a72d9
Compare
b150a38 to
5f1695c
Compare
a4f584d to
959378f
Compare
959378f to
eb0a5a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
window_title_formatandwindow_title_separatorsettings for customizing the window title${projectName},${fileName},${filePath},${relativePath},${fileStem},${remoteName},${remoteHost},${appName}, and${separator}as the native Zed window-title variables↗/↙indicator hard-appendedwindow.title/window.titleSeparatoraliases into Zed's canonical variables during settings import, including${appName}passthrough support and mapping VS Code's${activeEditorMedium}onto Zed's${relativePath}last_window_titlecache to skip redundant platform updatesAn alternative approach is at #49638. I went with
${variable}names over$ZED_*, canonical Zed variable names with VS Code aliases handled at import time, kept${separator}as the only structural token, and left${dirty}out of scope.Implementation reasoning and notes
Variables considered but not included
set_window_edited) felt like a separate design call I wasn't confident making here.A separator-style config for each of collab/shared/dirty would solve the above, but I didn't want to add too many additional settings initially.
Performance
update_window_titleis on a hot path, so two short-circuits apply:absolute_path, relative-path string,file_stem,remote_connection_options,ReleaseChannel::try_global) are gated ontemplate.contains(...)viaWindowTitleNeeds::from_template, so the default template avoids the extra work.last_window_titlecache still skips the platform call when the rendered title is unchanged.Screenshots
Settings Editor entries for

window_title_formatandwindow_title_separator:Customized Zed window titles in AltTab app switcher (remote, local, empty):

Self-Review Checklist:
Closes #14534
Release Notes:
window_title_format/window_title_separator, including${appName}/${remoteName}/${remoteHost}variables and VS Codewindow.titleimport support