kerol2r20 / windows-terminal-context-menu Goto Github PK
View Code? Open in Web Editor NEWπ This is a simple script to add right click context menu for your best Windows terminal β€
π This is a simple script to add right click context menu for your best Windows terminal β€
If you don't have WT installed but you have WT Preview the script can't find the correct path
It'd be great if by right-clicking with SHIFT the menu would instead show options to open each terminal in elevated Administrator mode (prompting user for admin privileges if needed)
Hey, thanks for the script. You should add the following:
mkdir $resourcePath
before copying the icons so that the script doesn't fail to run the first time if the folder doesn't exist. And maybe an rmdir for uninstall.
Even after doing so, something seems off with the registry keys, I'm getting this:
Any clue why that might happen? Edit: seems like it's not picking up my profiles correctly from the raw JSON although it's valid.
Thanks!
###hey guys, whenever I add firebase( core, auth, database ) to my flutter project I face this error:
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring project ':firebase_core'.
Could not resolve all artifacts for configuration ':firebase_core:classpath'. Could not download builder.jar (com.android.tools.build:builder:3.3.0) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.3.0/builder-3.3.0.jar'. > Premature end of Content-Length delimited message body (expected: 30631026; received: 6553552 Could not download kotlin-stdlib-jdk8.jar (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11) > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.11/kotlin-stdlib-jdk8-1.3.11.jar'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.11/kotlin-stdlib-jdk8-1.3.11.jar'. > jcenter.bintray.com Could not find jetifier-processor.jar (com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/jetifier/jetifier-processor/1.0.0-beta02/jetifier-processor-1.0.0-beta02.jar Could not find bundletool.jar (com.android.tools.build:bundletool:0.6.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.6.0/bundletool-0.6.0.jar Could not find jetifier-core.jar (com.android.tools.build.jetifier:jetifier-core:1.0.0-beta02). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/jetifier/jetifier-core/1.0.0-beta02/jetifier-core-1.0.0-beta02.jar Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.3.11) > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.3.11/kotlin-reflect-1.3.11.jar'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.3.11/kotlin-reflect-1.3.11.jar'. > jcenter.bintray.com Could not download kotlin-stdlib-jdk7.jar (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.11) > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.11/kotlin-stdlib-jdk7-1.3.11.jar'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.11/kotlin-stdlib-jdk7-1.3.11.jar'. > jcenter.bintray.com Could not download kotlin-stdlib.jar (org.jetbrains.kotlin:kotlin-stdlib:1.3.11) > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.3.11/kotlin-stdlib-1.3.11.jar'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.3.11/kotlin-stdlib-1.3.11.jar'. > jcenter.bintray.com Could not download kotlin-stdlib-common.jar (org.jetbrains.kotlin:kotlin-stdlib-common:1.3.11) > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.11/kotlin-stdlib-common-1.3.11.jar'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.11/kotlin-stdlib-common-1.3.11.jar'. > jcenter.bintray.com Failed to notify project evaluation listener. Could not get unknown property 'android' for project ':firebase_core' of type org.gradle.api.Project. Could not find method implementation() for arguments [project ':firebase_core_web'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 8m 1s Exception: Gradle task assembleDebug failed with exit code 1
I have followed the instruction of installing firebase sdk into a flutter project and this is my app\build.gradel:
` def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the
local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID
(https://developer.android.com/studio/build/application-id.html).
applicationId "com.saad2002.falafeelo"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics:17.4.3'
}
`
Launching windows terminal using the context menu after running this script bugs out the icons on the profiles on windows terminal. This doesn't seem to happen when using the "as administrator" option, or when running windows terminal through its icon.
Opening windows terminal from context path:
Hi,
First of all I would like to thank you very much for the script, it is working very well,
very happy about that π.
In the readme you say that for make the script working you need to set executionPolicy to remoteSigned
, but with the policy like that the script will not be launched by powershell.
For make it run you must to set the policy to Unrestricted
with the command
Set-ExecutionPolicy Unrestricted
And then the script will be launched correctly
Thank you for this project!
I like my default shell menu to be clean. Most dev options I "hide" using the Extended
string value in regedit.
Iβve got no clue about PowerShell logic, but maybe you can allow users to set parameters. That is for this scenario: SetupContextMenu.ps1 --Extended
When I execute the scripte with powershell "AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
he tells me that this file doesn't exist.
If a Terminal window already exists; open as Tab in that existing window. Don't create separate window.
Hi! It would be great if there is an option to have all the shortcuts directly in the context menu and not in a submenu. With this upgrade, it would be faster to open the terminal only by 1 click, instead of doing two clicks and losing time.
Thank you for making this tool <3!
Add & to some strings can be useful:
$contextMenuLabel
= "Open Windows &Terminal here"
In function Add-SubmenuReg (add parameter $index)
`[void](New-ItemProperty -Path
The contextmenus does not work if the username has a space in between. I was having the problem. Then I fixed it by putting the path inside an inverted comma. I believe you can replace line 140 i.e this
$command_f = "$env:LOCALAPPDATA\Microsoft\WindowsApps\wt.exe -p `"$profileName`" -d `"%V\.`""
to this
$command_f = "`"$env:LOCALAPPDATA\Microsoft\WindowsApps\wt.exe`" -p `"$profileName`" -d `"%V\.`""
Hello,
Please Add Context Menu to Drives (like below image)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Drive\shell\WindowsTerminal]
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\WindowsTerminal"
"Icon"="C:\\Users\\Alireza\\AppData\\Local\\WindowsTerminalContextIcons\\terminal.ico"
"MUIVerb"="Open Windows Terminal here"
So fun fact, I didn't have a 'shell' key in either Directory or Directory\Background in HKCU, so the script kept failing until I realized why, and manually created them. You may want to add some logic to check for both of those keys prior to attempting to create the "WindowsTerminal" key under them.
I added git bash in my windows terminal:
{
"guid": "{00000000-0000-0000-0000-000000000001}",
"name": "Git Bash",
"commandline": "\"%PROGRAMFILES%/git/usr/bin/bash.exe\" -i -l",
"icon": "C:/Program Files/Git/mingw64/share/git/git-for-windows.ico",
"backgroundImage": "%OneDrive%/.config/.assets/git.jpg",
"backgroundImageOpacity": 0.1,
"startingDirectory": "%OneDrive%"
},
My config file looks like:
"{00000000-0000-0000-0000-000000000001}": {
"icon": "git.ico",
"label": "Git Bash"
},
However, after running SetupContextMenu.ps1
I assigns all Shells successfully except Git Bash. Any clue whatβs the issue here?
It would be really good if it had bash support
Cygwin maps Linux POSIX paths to Windows Path and prefixes the current path with /cygdrive/
That means, assume you are in this folder: C:\Users\Username\git\project
the corresponding cygwin path would be /cygdrive/c/Users/Username/git/project
Could you prepend the /cygdrive/
if a users defines an id which contains cygwin
in the commandline
property. Iβm not a Powershell scripter, so it woud take too much time for me.
When I ran the SetupContextMenu.ps1 script, the git bash icon on the installer folder isn't defined, instead, the unknown.ico is defined.
Hello, thanks for the great work. But somehow, I found that the second layer of the context menu won't show up when used with Double Commander.
User configs generated before microsoft/terminal#4556 store their profile list under .profiles rather than .profiles.list. There should probably be a disclaimer in the readme if not a check in the program to handle this on the fly.
@kalaschnik this is what caused the error you got, you can get around it by either deleting and regenerating your user config or editing the script to source .profiles instead of .profiles.list
As is probably already known, the powershell run as command for admin flashes windows during execution, and because of that it kinda looks janky.
This led me to look for a solution. I found that nearly all script solutions were just unreliable and/or too cumbersome. So I fixed it in a simpler way, using an executable designed to hide all windows + run as admin. Much easier.
I would issue a pull request, however I'm not sure whether this addition will be welcome.
Please check out my latest 2 commits in the repo to see what I did if you like it. I'd love to submit it as a PR if it's acceptable.
https://github.com/cherryleafroad/Windows-terminal-context-menu
P.S. I'm sure you're probably thinking, "but what's in the exe?". No worries, I got you covered!
Check my other repo to see the code
https://github.com/cherryleafroad/run-hidden
https://github.com/cherryleafroad/run-hidden/blob/master/Program.cs
In fact, there is a benefit towards my solution. It is MUCH FASTER at startup than the previous solution, and more stable and reliable (from a aesthetic pov)
...should read documentation first...
I have a few suggestions :
Keep up the good work !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.