mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
feat(pwsh): missing hyperlinks for Get-PoshThemes -list (#1166)
This commit is contained in:
parent
3f593c76a2
commit
5321ae116e
|
@ -7,7 +7,8 @@
|
||||||
# that pop up when we don't
|
# that pop up when we don't
|
||||||
if ($ExecutionContext.SessionState.LanguageMode -ne "ConstrainedLanguage") {
|
if ($ExecutionContext.SessionState.LanguageMode -ne "ConstrainedLanguage") {
|
||||||
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||||
} elseif ($env:POSH_CONSTRAINED_LANGUAGE -ne 1) {
|
}
|
||||||
|
elseif ($env:POSH_CONSTRAINED_LANGUAGE -ne 1) {
|
||||||
Write-Host "[WARNING] ConstrainedLanguage mode detected, unable to set console to UTF-8.
|
Write-Host "[WARNING] ConstrainedLanguage mode detected, unable to set console to UTF-8.
|
||||||
When using PowerShell in ConstrainedLanguage mode, please set the
|
When using PowerShell in ConstrainedLanguage mode, please set the
|
||||||
console mode manually to UTF-8. See here for more information:
|
console mode manually to UTF-8. See here for more information:
|
||||||
|
@ -95,17 +96,18 @@ function Set-PoshPrompt {
|
||||||
#>
|
#>
|
||||||
function Get-Hyperlink {
|
function Get-Hyperlink {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory, ValuefromPipeline = $True)]
|
||||||
[string]$uri,
|
[string]$uri,
|
||||||
|
[Parameter(ValuefromPipeline = $True)]
|
||||||
[string]$name
|
[string]$name
|
||||||
)
|
)
|
||||||
$esc = [char]27
|
$esc = [char]27
|
||||||
if ("" -eq $name) {
|
if ("" -eq $name) {
|
||||||
$name = $uri
|
$name = $uri
|
||||||
}
|
}
|
||||||
if ($env:WSL_DISTRO_NAME -ne $null){
|
if ($null -ne $env:WSL_DISTRO_NAME) {
|
||||||
# wsl conversion if needed
|
# wsl conversion if needed
|
||||||
$uri= &wslpath -m $uri
|
$uri = &wslpath -m $uri
|
||||||
}
|
}
|
||||||
return "$esc]8;;file://$uri$esc\$name$esc]8;;$esc\"
|
return "$esc]8;;file://$uri$esc\$name$esc]8;;$esc\"
|
||||||
}
|
}
|
||||||
|
@ -139,7 +141,7 @@ function Get-PoshThemes() {
|
||||||
$themes = Get-ChildItem -Path "$PSScriptRoot\themes\*" -Include '*.omp.json' | Sort-Object Name
|
$themes = Get-ChildItem -Path "$PSScriptRoot\themes\*" -Include '*.omp.json' | Sort-Object Name
|
||||||
Write-Host ("-" * $consoleWidth)
|
Write-Host ("-" * $consoleWidth)
|
||||||
if ($list -eq $true) {
|
if ($list -eq $true) {
|
||||||
$themes | Select-Object fullname | Format-Table -HideTableHeaders
|
$themes | Select-Object @{ Name = 'hyperlink'; Expression = { Get-Hyperlink -uri $_.fullname } } | Format-Table -HideTableHeaders
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$poshCommand = Get-PoshCommand
|
$poshCommand = Get-PoshCommand
|
||||||
|
|
Loading…
Reference in a new issue