【问题标题】:scoop installed git bash: "Open Git Bash" here context menu舀安装的 git bash:“Open Git Bash”在这里上下文菜单
【发布时间】:2019-04-25 03:08:37
【问题描述】:

我已经在 Windows 10 x64 上通过 Scoop 安装了 git。

使用来自this answer 的详细说明,我创建了自己的 reg 脚本,在 Windows 资源管理器的上下文菜单中为我自己的用户添加“打开 Git Bash”命令:

Windows Registry Editor Version 5.00

[HKEY_USERS\user-sid\Software\Classes\*\shell\Open Git Bash]
@="Open Git Bash"
"Icon"="C:\\Users\\fritzmg\\scoop\\shims\\git-bash.exe"

[HKEY_USERS\user-sid\Software\Classes\*\shell\Open Git Bash\command]
@="\"C:\\Users\\fritzmg\\scoop\\shims\\git-bash.exe\" \"--cd=%1\""

; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_USERS\user-sid\Software\Classes\Directory\shell\bash]
@="Open Git Bash"
"Icon"="C:\\Users\\fritzmg\\scoop\\shims\\git-bash.exe"


[HKEY_USERS\user-sid\Software\Classes\Directory\shell\bash\command]
@="\"C:\\Users\\fritzmg\\scoop\\shims\\git-bash.exe\" \"--cd=%1\""

; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_USERS\user-sid\Software\Classes\Directory\Background\shell\bash]
@="Open Git Bash"
"Icon"="C:\\Users\\fritzmg\\scoop\\shims\\git-bash.exe"

[HKEY_USERS\user-sid\Software\Classes\Directory\Background\shell\bash\command]
@="\"C:\\Users\\fritzmg\\scoop\\shims\\git-bash.exe\" \"--cd=%v.\""

但是,这样做有两个问题:

1。图标不起作用

上下文菜单中的图标不起作用:

可能这更像是一个独家新闻。我不确定 scoop 是如何创建这些垫片的。

2。两个 git bash 窗口打开

当我实际使用上下文菜单选项时,会打开两个 git bash 窗口:

一个是实际的 git bash,另一个是“git-bash.exe”。关闭任何一个窗口都会同时关闭两个窗口。

当然,我希望它就像我直接从 https://git-scm.com/download/win 下载并安装了 git 一样。可能有人对如何缓解这些问题有任何见解?

【问题讨论】:

    标签: windows git registry git-bash scoop-installer


    【解决方案1】:

    shim.exe 没有图标,因此无法显示。 在这种情况下,建议使用current 版本路径。 (例如~\scoop\apps\git\current\git-bash.exe

    将图标路径改为:

    [HKEY_USERS\user-sid\Software\Classes\Directory\Background\shell\bash]
    @="Open Git Bash"
    "Icon"="C:\\Users\\fritzmg\\scoop\\apps\\git\\current\\git-bash.exe"
    

    【讨论】:

    • 啊,谢谢,我没有注意到每个应用程序目录中的 current 符号链接 :)
    猜你喜欢
    • 2014-09-12
    • 2022-01-01
    • 2019-01-29
    • 2018-04-17
    • 2013-08-25
    • 1970-01-01
    • 2020-09-21
    • 1970-01-01
    • 2022-08-13
    相关资源
    最近更新 更多