Skip to content
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

Add Microsoft Terminal profile shortcut #200

Merged
merged 37 commits into from
May 15, 2024

Conversation

marcoesters
Copy link
Contributor

Description

The Windows Terminal provides the option to application to its profile. This is a handy feature for terminal-based applications.

This PR adds the option to create a Microsoft Terminal profile. It is limited to non-admin installations because, to my knowledge, there is no global %LOCALAPPDATA% file in which the settings file resides.

For now, the terminal profiles are identified by their name, which the terminal uses to create a GUID. It is, in principle, possible to create our own GUIDs using the uuid module from other types of heuristics, but I decided to keep using the name of the menu item to avoid having profiles with duplicate names.

Closes #196

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label May 2, 2024
@marcoesters marcoesters marked this pull request as ready for review May 2, 2024 18:19
@marcoesters marcoesters requested a review from a team as a code owner May 2, 2024 18:19
menuinst/platforms/win.py Outdated Show resolved Hide resolved
menuinst/platforms/win.py Outdated Show resolved Hide resolved
menuinst/platforms/win.py Outdated Show resolved Hide resolved
@marcoesters marcoesters requested a review from jaimergp May 7, 2024 15:39
menuinst/platforms/win.py Outdated Show resolved Hide resolved
tests/test_api.py Outdated Show resolved Hide resolved
tests/test_api.py Outdated Show resolved Hide resolved
tests/test_api.py Outdated Show resolved Hide resolved
tests/test_api.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
@marcoesters marcoesters requested a review from jaimergp May 13, 2024 22:37
tests/conftest.py Outdated Show resolved Hide resolved
jaimergp
jaimergp previously approved these changes May 15, 2024
Copy link
Contributor

@jaimergp jaimergp left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to merge once you are ready!

If you have a screenshot of how it looks like on Windows, I think it would be nice to have it posted here. If it's too much trouble, no worries.

Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
@marcoesters
Copy link
Contributor Author

LGTM. Feel free to merge once you are ready!

If you have a screenshot of how it looks like on Windows, I think it would be nice to have it posted here. If it's too much trouble, no worries.

I will create one and post it before I merge.

@marcoesters
Copy link
Contributor Author

Here is a menu file to create the git bash terminal profile and the screenshot shows how it look like in the Windows Terminal.

{
  "$schema": "https://json-schema.org/draft-07/schema",
  "$id": "https://schemas.conda.io/menuinst-1.schema.json",
  "menu_name": "git bash",
  "menu_items": [
    {
      "name": "git bash",
      "command": [
          "C:\\Program Files\\Git\\bin\\bash.exe",
          "-li"
      ],
      "platforms": {
        "win": {
            "quicklaunch": false,
            "desktop": false,
            "windows_terminal_profile": "Git Bash",
            "icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico"
        }
      }
    }
  ]
}

Screenshot 2024-05-15 at 1 40 22 PM

@marcoesters marcoesters merged commit 416eaf9 into conda:main May 15, 2024
18 checks passed
@marcoesters marcoesters deleted the windows-terminal-profile branch May 15, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Status: 🏁 Done
Development

Successfully merging this pull request may close these issues.

Add Windows Terminal profile option
3 participants