-
Notifications
You must be signed in to change notification settings - Fork 37.5k
Terminal tab title: Show "~" instead of "$HOME" #275378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@microsoft-github-policy-service agree |
|
👋 @meganrogge I made this PR for #274200, which you got assigned to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for tildifying (replacing user home paths with ~) in terminal instance labels. When displaying terminal working directories, paths under the user's home directory now show as ~/path instead of /home/user/path.
Key changes:
- Modified terminal label computation to use the
tildifyutility function for CWD paths - Added special handling for the exact user home path to display as
~ - Updated test fixtures to include a default
userHomevalue and added test cases for tildification scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminal/browser/terminalInstance.ts | Imports tildify function, adds os to type signatures, implements tildification logic for CWD paths in label computation |
| src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts | Updates default userHome in test fixture from undefined to /home/user, adds three new test cases for tildification behavior |
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts:305
- The return type of
createInstanceis missing theosproperty that was added to therefreshLabelandcomputeLabelmethod signatures in the production code. This type mismatch could cause the tests to not properly validate the OS-specific behavior of tildification.
function createInstance(partial?: Partial<ITerminalInstance>): Pick<ITerminalInstance, 'shellLaunchConfig' | 'shellType' | 'userHome' | 'cwd' | 'initialCwd' | 'processName' | 'sequence' | 'workspaceFolder' | 'staticTitle' | 'capabilities' | 'title' | 'description'> {
Co-authored-by: Copilot <[email protected]>
|
Hi @meganrogge, will you or someone else be able to review this to get it merged? It's a pretty trivial code change for a small but meaningful UI improvement. |
meganrogge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
|
Failing tests on Windows |
Fixes #274200