Giter Club home page Giter Club logo

Comments (9)

kerol2r20 avatar kerol2r20 commented on May 24, 2024 1

Hi @regul4rj0hn

Could you pull the latest version, and try to install it again.
I find that windows may cache the context menu.
If you found that the icon still empty, you may try to re-login again.

Thanks!

from windows-terminal-context-menu.

kerol2r20 avatar kerol2r20 commented on May 24, 2024 1

Hi @Nomelas

I do some modify of the registry scope.
Now it only modify the HKEY_CURRENT_USER scope entry, so no longer need to run as admin.
You can try it again 😊

I don't really understand about the context menu does not show up in subdirectories under windows libraries. Could you give me a screenshot?

Thank you for your PRs , I found some style mismatch my original one.
I would give some review for that.

from windows-terminal-context-menu.

Nomelas avatar Nomelas commented on May 24, 2024 1

I found the reason, it lives under a different location in the registry... The new pr addresses it but returns the scope to requiring admin :/

from windows-terminal-context-menu.

kerol2r20 avatar kerol2r20 commented on May 24, 2024 1

New version of Windows terminal would have a different default profiles.json.
Could you backup your origin profiles.json, then open windows terminal again.
This will generate a new one.

from windows-terminal-context-menu.

regul4rj0hn avatar regul4rj0hn commented on May 24, 2024

Yep, that was it, the icons are cached, logout and back in fixes that bit. That said, it's not being bind correctly:
image

The other problem with the profiles still stands too. If I Write-Host "Raw content: $rawContent" I get all the profiles.json file, but after running ConvertFrom-Json, the $profiles variable is empty. I'll troubleshoot some more later and let you know.

Thanks for the help!

from windows-terminal-context-menu.

kerol2r20 avatar kerol2r20 commented on May 24, 2024

Could you help me check if the following appear in your profiles.json.

    "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png"

I think there may be something wrong about the RegExp used to remove json comment.

After Powershell 6, it can handle JSON with comment out of box.
But most of users may not use such new version. I want to offer more capabilities.

I have tried to fix it on latest commit.
Hope this will resolve your problem.

from windows-terminal-context-menu.

Nomelas avatar Nomelas commented on May 24, 2024

submitted PR again (after manually merging new changes)

This must be set (As Admin):
Set-ExecutionPolicy Unrestricted

But everything else now works, seemingly without admin

EDIT: Could be the differnce in windows/ps versions as well, idk

from windows-terminal-context-menu.

Nomelas avatar Nomelas commented on May 24, 2024

Actually found 1 issue:
the context menu does not show up in subdirectories under windows libraries - but if I nav to the same dir ouside of the Libraries shortcuts, it works... strange

This is my first time messing around with powershell :/

from windows-terminal-context-menu.

regul4rj0hn avatar regul4rj0hn commented on May 24, 2024

Could you help me check if the following appear in your profiles.json

Certainly, here's a chunk of my profiles:

image

Looks like the icon property is in a couple different formats.

Running as admin, getting a bunch of errors related to the changes. Here:

PS D:\Projects\Windows-terminal-context-menu> .\SetupContextMenu.ps1
Copy icons => C:\Users\mauro\AppData\Local\WindowsTerminalContextIcons\
New-Item : The registry key at the specified path does not exist.
At D:\Projects\Windows-terminal-context-menu\SetupContextMenu.ps1:55 char:8
+ [void](New-Item -Path $contextMenuRegPath)
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (HKEY_CURRENT_US...Directory\shell:String) [New-Item], ArgumentExceptio
   n
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.NewItemCommand

New-ItemProperty : Cannot find path 'HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminal' because it
does not exist.
At D:\Projects\Windows-terminal-context-menu\SetupContextMenu.ps1:56 char:8
+ [void](New-ItemProperty -Path $contextMenuRegPath -Name ExtendedSubCo ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKEY_CURRENT_US...WindowsTerminal:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

New-ItemProperty : Cannot find path 'HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminal' because it
does not exist.
At D:\Projects\Windows-terminal-context-menu\SetupContextMenu.ps1:57 char:8
+ [void](New-ItemProperty -Path $contextMenuRegPath -Name Icon -Propert ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKEY_CURRENT_US...WindowsTerminal:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

New-ItemProperty : Cannot find path 'HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminal' because it
does not exist.
At D:\Projects\Windows-terminal-context-menu\SetupContextMenu.ps1:58 char:8
+ [void](New-ItemProperty -Path $contextMenuRegPath -Name MUIVerb -Prop ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKEY_CURRENT_US...WindowsTerminal:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

Add top layer menu (shell) => Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminal
New-Item : The registry key at the specified path does not exist.
At D:\Projects\Windows-terminal-context-menu\SetupContextMenu.ps1:61 char:8
+ [void](New-Item -Path $contextBGMenuRegPath)
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (HKEY_CURRENT_US...ackground\shell:String) [New-Item], ArgumentExceptio
   n
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.NewItemCommand

New-ItemProperty : Cannot find path 'HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\WindowsTerminal'
because it does not exist.
At D:\Projects\Windows-terminal-context-menu\SetupContextMenu.ps1:62 char:8
+ [void](New-ItemProperty -Path $contextBGMenuRegPath -Name ExtendedSub ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKEY_CURRENT_US...WindowsTerminal:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

New-ItemProperty : Cannot find path 'HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\WindowsTerminal'
because it does not exist.
At D:\Projects\Windows-terminal-context-menu\SetupContextMenu.ps1:63 char:8
+ [void](New-ItemProperty -Path $contextBGMenuRegPath -Name Icon -Prope ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKEY_CURRENT_US...WindowsTerminal:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

New-ItemProperty : Cannot find path 'HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\WindowsTerminal'
because it does not exist.
At D:\Projects\Windows-terminal-context-menu\SetupContextMenu.ps1:64 char:8
+ [void](New-ItemProperty -Path $contextBGMenuRegPath -Name MUIVerb -Pr ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKEY_CURRENT_US...WindowsTerminal:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

Add top layer menu (background) => Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminal
Add new entry  => Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\WindowsTerminal\shell\
Add new entry  => Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\WindowsTerminal\shell\
Add new entry  => Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\WindowsTerminal\shell\
Add new entry  => Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\WindowsTerminal\shell\
Add new entry  => Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\WindowsTerminal\shell\

from windows-terminal-context-menu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.