Repository: microsoft/terminal (language: cpp)

Issue:
Feature request: option to remove profile icon completely
<!-- 
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING:
1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement.
2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement.
3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number).
4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement.
5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement.

All good? Then proceed!
-->

# Description of the new feature/enhancement

Provide an option in settings.json to remove the icon for a profile completely, and reclaim the space in the tab bar to display (more of) the profile's name/tab title.

Use case: I routinely work with a large number of open tabs, in which case the profile icon takes up between 1/3 to 1/2 of the available tab width, meaning only the first 3-4 characters of the window title are shown. This is insufficient for me to quickly identify and switch between open tabs. 

While I do appreciate the cute row of Tux-en at top of my screen :) (most of my tabs are ssh sessions to remote Linux machines), I'd rather have the real-estate used more productively.

Tried the following to achieve this in 1.21, without success:
- Setting `"icon": ""` in the profile definition -> causes WT to throw an error about invalid icon path
- Setting `"icon": null` in the profile definition -> does nothing; the inbuilt default icon for the profile will still be used
- Setting the icon path to a 1x1 pixel transparent .png (thought I was being clever here) -> does achieve "blanking out" the profile icon (the default icon will no longer be shown), but does not move the profile title any further to the left in the tab.

# Proposed technical implementation details (optional)

- Allow some variant of `"icon": "none"`, `"icon": ""` or similar to be set in the profile definition
- When configured, the icon should be removed from the tab completely, and the tab title shifted as far left as possible. 


Discussion / hints:
_Huh._ 4ff38c260f02388385ce6b424ef84a26db9f39aa should have introduced support for `"icon": "none"`.

We've marked this up as a bug. Thanks!
@carlos-zamora I would be interested in working on this!
>  I would be interested in working on this!

Thanks for you interest @LouizaMak! I'm already working in this space though with #17965 (and I plan on fixing it as a part of that PR). I suggest working on a different issue. Issues tagged as "Help-Wanted" (see [this query](https://github.com/microsoft/terminal/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Help%20Wanted%22)) would be a good place to start 😊

Also, we're happy to take PRs, so no need to comment on the issue you're interested in. Just get coding and open a PR on our repo. Excited to see it come in!

Fix patch:
diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp b/src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp
index d665176f2cb..6b412d28b68 100644
--- a/src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp
+++ b/src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp
@@ -531,7 +531,9 @@ void CascadiaSettings::_validateMediaResources()
         // Explicitly just use the Icon here, not the EvaluatedIcon. We don't
         // want to blow up if we fell back to the commandline and the
         // commandline _isn't an icon_.
-        if (const auto icon = profile.Icon(); icon.size() > 2)
+        // GH #17943: "none" is a special value interpreted as "remove the icon"
+        static constexpr std::wstring_view HideIconValue{ L"none" };
+        if (const auto icon = profile.Icon(); icon.size() > 2 && icon != HideIconValue)
         {
             const auto iconPath{ wil::ExpandEnvironmentStringsW<std::wstring>(icon.c_str()) };
             try


Test patch: