diff --git a/terminus-terminal/package.json b/terminus-terminal/package.json index 7c745115..4889dd38 100644 --- a/terminus-terminal/package.json +++ b/terminus-terminal/package.json @@ -47,7 +47,7 @@ "node-pty": "^0.8.0", "ps-node": "^0.1.6", "runes": "^0.4.2", - "windows-native-registry": "^1.0.4" + "windows-native-registry": "^1.0.6" }, "optionalDependencies": { "macos-native-processlist": "^1.0.0", diff --git a/terminus-terminal/src/shells/cygwin32.ts b/terminus-terminal/src/shells/cygwin32.ts index 238abd63..94454172 100644 --- a/terminus-terminal/src/shells/cygwin32.ts +++ b/terminus-terminal/src/shells/cygwin32.ts @@ -1,6 +1,6 @@ import * as path from 'path' import { Injectable } from '@angular/core' -import { getRegistryValue } from 'windows-native-registry' +import { getRegistryValue, HK } from 'windows-native-registry' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider, IShell } from '../api' @@ -18,7 +18,7 @@ export class Cygwin32ShellProvider extends ShellProvider { return [] } - let cygwinPath = getRegistryValue('HKLM', 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir') + let cygwinPath = getRegistryValue(HK.LM, 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir') if (!cygwinPath) { return [] diff --git a/terminus-terminal/src/shells/cygwin64.ts b/terminus-terminal/src/shells/cygwin64.ts index 06ed8b63..cfb149a6 100644 --- a/terminus-terminal/src/shells/cygwin64.ts +++ b/terminus-terminal/src/shells/cygwin64.ts @@ -1,6 +1,6 @@ import * as path from 'path' import { Injectable } from '@angular/core' -import { getRegistryValue } from 'windows-native-registry' +import { getRegistryValue, HK } from 'windows-native-registry' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider, IShell } from '../api' @@ -18,7 +18,7 @@ export class Cygwin64ShellProvider extends ShellProvider { return [] } - let cygwinPath = getRegistryValue('HKLM', 'Software\\Cygwin\\setup', 'rootdir') + let cygwinPath = getRegistryValue(HK.LM, 'Software\\Cygwin\\setup', 'rootdir') if (!cygwinPath) { return [] diff --git a/terminus-terminal/src/shells/gitBash.ts b/terminus-terminal/src/shells/gitBash.ts index 3eb5fcf0..98547b8f 100644 --- a/terminus-terminal/src/shells/gitBash.ts +++ b/terminus-terminal/src/shells/gitBash.ts @@ -1,6 +1,6 @@ import * as path from 'path' import { Injectable } from '@angular/core' -import { getRegistryValue } from 'windows-native-registry' +import { getRegistryValue, HK } from 'windows-native-registry' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider, IShell } from '../api' @@ -18,10 +18,10 @@ export class GitBashShellProvider extends ShellProvider { return [] } - let gitBashPath = getRegistryValue('HKLM', 'Software\\GitForWindows', 'InstallPath') + let gitBashPath = getRegistryValue(HK.LM, 'Software\\GitForWindows', 'InstallPath') if (!gitBashPath) { - gitBashPath = getRegistryValue('HKCU', 'Software\\GitForWindows', 'InstallPath') + gitBashPath = getRegistryValue(HK.CU, 'Software\\GitForWindows', 'InstallPath') } if (!gitBashPath) { diff --git a/terminus-terminal/src/shells/powershellCore.ts b/terminus-terminal/src/shells/powershellCore.ts index e98e2114..fd1ef220 100644 --- a/terminus-terminal/src/shells/powershellCore.ts +++ b/terminus-terminal/src/shells/powershellCore.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core' -import { getRegistryValue } from 'windows-native-registry' +import { getRegistryValue, HK } from 'windows-native-registry' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider, IShell } from '../api' @@ -16,7 +16,7 @@ export class PowerShellCoreShellProvider extends ShellProvider { return [] } - const pwshPath = getRegistryValue('HKLM', 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\pwsh.exe', '') + const pwshPath = getRegistryValue(HK.LM, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\pwsh.exe', '') if (!pwshPath) { return [] diff --git a/terminus-terminal/src/shells/wsl.ts b/terminus-terminal/src/shells/wsl.ts index 5d487757..f3f0bf35 100644 --- a/terminus-terminal/src/shells/wsl.ts +++ b/terminus-terminal/src/shells/wsl.ts @@ -1,7 +1,7 @@ import * as fs from 'mz/fs' import slug from 'slug' -import { getRegistryKey, listRegistrySubkeys } from 'windows-native-registry' +import { getRegistryKey, listRegistrySubkeys, HK } from 'windows-native-registry' import { Injectable } from '@angular/core' import { HostAppService, Platform } from 'terminus-core' @@ -36,7 +36,7 @@ export class WSLShellProvider extends ShellProvider { }] const lxssPath = 'Software\\Microsoft\\Windows\\CurrentVersion\\Lxss' - let lxss = getRegistryKey('HKCU', lxssPath) + let lxss = getRegistryKey(HK.CU, lxssPath) if (!lxss || !lxss.DefaultDistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) { if (await fs.exists(bashPath)) { return [{ @@ -52,8 +52,8 @@ export class WSLShellProvider extends ShellProvider { return [] } } - for (let child of listRegistrySubkeys('HKCU', lxssPath)) { - let childKey = getRegistryKey('HKCU', lxssPath + '\\' + child) + for (let child of listRegistrySubkeys(HK.CU, lxssPath)) { + let childKey = getRegistryKey(HK.CU, lxssPath + '\\' + child) if (!childKey.DistributionName) { continue } diff --git a/terminus-terminal/yarn.lock b/terminus-terminal/yarn.lock index 0a16dc8e..1ef6ad82 100644 --- a/terminus-terminal/yarn.lock +++ b/terminus-terminal/yarn.lock @@ -239,10 +239,10 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -windows-native-registry@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/windows-native-registry/-/windows-native-registry-1.0.4.tgz#95cf1b9eb4d7a00fc7fe8299ac530d9d87c40b06" - integrity sha512-RVjg0af8EXYypw452jQzrhkvg0Lh3IXTrE7NZjAuLq+j1Hwey43AZigWb5eecOoXUIs0rGVMqC8wea7khWwKbw== +windows-native-registry@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/windows-native-registry/-/windows-native-registry-1.0.6.tgz#6271cef068ffb432337751fc1f971a25187cd8d5" + integrity sha512-GTu4yRg4FOThNbBkuP/OeTOt8kZm+nTNCoZjmIol0HFefXoYCkzBZX0METJYZLL0nbgis+QzqRhJAKkMfy/VDA== dependencies: nan "^2.12.1"