Skip to content

Close #134566: Added settings for terminal tab default color/icon - #147463

Merged
Daniel Imms (Tyriar) merged 9 commits into
microsoft:mainfrom
amanasifkhalid:terminal-tab-defaults
Jul 7, 2022
Merged

Daniel Imms (Tyriar) merged 9 commits into
microsoft:mainfrom
amanasifkhalid:terminal-tab-defaults

Conversation

@amanasifkhalid

Copy link
Copy Markdown
Contributor

This PR fixes #134566 by adding the settings terminal.integrated.tabs.defaultColor and terminal.integrated.tabs.defaultIcon. These settings support the same values as the "Change Terminal Color" and "Change Terminal Icon" actions. Below is a demo of this new workflow:

terminal-profile-demo.mp4

@Tyriar Daniel Imms (Tyriar) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR Aman Khalid (@amanasifkhalid). This needed a little extra work, essentially replacing all instances of Codicon.terminal inside the terminal component as there's a bit of complexity to the "resolving" of the icons. I think I caught all the cases.

@Tyriar

Copy link
Copy Markdown
Contributor

Megan Rogge (@meganrogge) a full review would be helpful here as the change turned out to be fairly large

@meganrogge

Copy link
Copy Markdown
Collaborator

works well 👍🏼 . I wonder if we should add a tag or include icon in the setting title for the icon's color to make it more discoverable?

Screen Shot 2022-07-06 at 8 34 43 PM

@meganrogge

Megan Rogge (meganrogge) commented Jul 7, 2022 •

Copy link
Copy Markdown
Collaborator

Reset to default resets it to the default that's configured - I wonder if that's what a user would expect - I'd sort of expect the color to go back to grey

reset.to.default.mov

@meganrogge

Megan Rogge (meganrogge) commented Jul 7, 2022 •

Copy link
Copy Markdown
Collaborator

works well 👍🏼 . I wonder if we should add a tag or include icon in the setting title for the icon's color to make it more discoverable?

Screen Shot 2022-07-06 at 8 34 43 PM

Going with terminal.integrated.tabs.defaultIconId and terminal.integrated.tabs.defaultIconColor yields this and IMO is more accurate

Screen Shot 2022-07-06 at 8 44 55 PM

@Tyriar

Daniel Imms (Tyriar) commented Jul 7, 2022 •

Copy link
Copy Markdown
Contributor

Reset to default resets it to the default that's configured - I wonder if that's what a user would expect - I'd sort of expect the color to go back to grey

I had it doing this at some point and it didn't feel right. We can wait for feedback?

Going with terminal.integrated.tabs.defaultIconId and terminal.integrated.tabs.defaultIconColor yields this and IMO is more accurate

I was trying to align the wording with profiles:

icon: {
description: localize('terminalProfile.icon', 'A codicon ID to associate with this terminal.'),
type: 'string',
enum: Array.from(Codicon.getAll(), icon => icon.id),
markdownEnumDescriptions: Array.from(Codicon.getAll(), icon => `$(${icon.id})`),
},
color: {
description: localize('terminalProfile.color', 'A theme color ID to associate with this terminal.'),
type: ['string', 'null'],
enum: [
'terminal.ansiBlack',
'terminal.ansiRed',
'terminal.ansiGreen',
'terminal.ansiYellow',
'terminal.ansiBlue',
'terminal.ansiMagenta',
'terminal.ansiCyan',
'terminal.ansiWhite'
],
default: null
},

I created a follow up in #154354 to add it to the setting description and align better since the profiles setting just uses icon and color.

@Tyriar
Daniel Imms (Tyriar) merged commit 72208d7 into microsoft:main Jul 7, 2022
@amanasifkhalid
Aman Khalid (amanasifkhalid) deleted the terminal-tab-defaults branch July 7, 2022 15:52
@meganrogge

Copy link
Copy Markdown
Collaborator

Just realized that this doesn't work in the case of the multi-root repository because the setting is per workspace ATM, so you can't distinguish between the terminals that way.

Folder settings are undefined when in a multi-root repo

@Tyriar

Copy link
Copy Markdown
Contributor

Folder settings are undefined when in a multi-root repo

Isn't it the other way; folder settings are only set when in a multi-root repo?

@meganrogge

Copy link
Copy Markdown
Collaborator

Daniel Imms (@Tyriar) I'm
Hoping I was just doing something wrong. See if you're able to configure this when in a multi repo workspace - I couldn't

@Tyriar

Copy link
Copy Markdown
Contributor

Megan Rogge (@meganrogge) fixing for august: #156806

@github-actions github-actions Bot locked and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to set the default color for the terminal on workspace folder

3 participants