Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Tabby
提交
601fff45
T
Tabby
项目概览
后端镜像
/
Tabby
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tabby
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
601fff45
编写于
9月 02, 2021
作者:
E
Eugene Pankov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
auto-search powershell $PATH
上级
73008442
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
1 deletion
+36
-1
tabby-local/package.json
tabby-local/package.json
+1
-0
tabby-local/src/shells/windowsStock.ts
tabby-local/src/shells/windowsStock.ts
+23
-1
tabby-local/yarn.lock
tabby-local/yarn.lock
+12
-0
未找到文件。
tabby-local/package.json
浏览文件 @
601fff45
...
...
@@ -22,6 +22,7 @@
"devDependencies"
:
{
"ansi-colors"
:
"^4.1.1"
,
"dataurl"
:
"0.1.0"
,
"hasbin"
:
"^1.2.3"
,
"ps-node"
:
"^0.1.6"
,
"runes"
:
"^0.4.2"
,
"utils-decorators"
:
"^1.8.3"
...
...
tabby-local/src/shells/windowsStock.ts
浏览文件 @
601fff45
import
*
as
path
from
'
path
'
import
*
as
fs
from
'
fs/promises
'
import
hasbin
from
'
hasbin
'
import
{
promisify
}
from
'
util
'
import
{
Injectable
}
from
'
@angular/core
'
import
{
HostAppService
,
Platform
}
from
'
tabby-core
'
import
{
ElectronService
}
from
'
tabby-electron
'
...
...
@@ -59,7 +62,7 @@ export class WindowsStockShellsProvider extends ShellProvider {
{
id
:
'
powershell
'
,
name
:
'
PowerShell
'
,
command
:
'
powershell.exe
'
,
command
:
await
this
.
getPowerShellPath
()
,
args
:
[
'
-nologo
'
],
icon
:
require
(
'
../icons/powershell.svg
'
),
env
:
{
...
...
@@ -68,4 +71,23 @@ export class WindowsStockShellsProvider extends ShellProvider {
},
]
}
private
async
getPowerShellPath
()
{
const
ps
=
'
powershell.exe
'
if
(
!
await
promisify
(
hasbin
)(
ps
))
{
for
(
const
searchPath
of
[
`
${
process
.
env
.
SystemRoot
}
\\System32\\WindowsPowerShell\\v1.0`
,
`
${
process
.
env
.
SystemRoot
}
\\System32`
,
process
.
env
.
SystemRoot
??
'
C:
\\
Windows
'
,
])
{
const
newPath
=
path
.
join
(
searchPath
,
ps
)
try
{
await
fs
.
stat
(
newPath
)
return
newPath
}
catch
{
}
}
}
return
ps
}
}
tabby-local/yarn.lock
浏览文件 @
601fff45
...
...
@@ -7,6 +7,11 @@ ansi-colors@^4.1.1:
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
async@~1.5:
version "1.5.2"
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=
connected-domain@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/connected-domain/-/connected-domain-1.0.0.tgz#bfe77238c74be453a79f0cb6058deeb4f2358e93"
...
...
@@ -17,6 +22,13 @@ dataurl@0.1.0:
resolved "https://registry.yarnpkg.com/dataurl/-/dataurl-0.1.0.tgz#1f4734feddec05ffe445747978d86759c4b33199"
integrity sha1-H0c0/t3sBf/kRXR5eNhnWcSzMZk=
hasbin@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/hasbin/-/hasbin-1.2.3.tgz#78c5926893c80215c2b568ae1fd3fcab7a2696b0"
integrity sha1-eMWSaJPIAhXCtWiuH9P8q3omlrA=
dependencies:
async "~1.5"
opentype.js@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/opentype.js/-/opentype.js-1.3.3.tgz#65b8645b090a1ad444065b784d442fa19d1061f6"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录