mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
parent
40a065da5a
commit
0d8b8591cc
|
@ -44,7 +44,7 @@ var toggleCmd = &cobra.Command{
|
||||||
newToggles = append(newToggles, segment)
|
newToggles = append(newToggles, segment)
|
||||||
}
|
}
|
||||||
|
|
||||||
cache.Set(platform.TOGGLECACHE, strings.Join(newToggles, ","), -1)
|
cache.Set(platform.TOGGLECACHE, strings.Join(newToggles, ","), 1440)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,18 @@ const (
|
||||||
LINUX = "linux"
|
LINUX = "linux"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func getPID() string {
|
||||||
|
pid := os.Getenv("POSH_PID")
|
||||||
|
if len(pid) == 0 {
|
||||||
|
pid = strconv.Itoa(os.Getppid())
|
||||||
|
}
|
||||||
|
return pid
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
pid = os.Getppid()
|
|
||||||
lock = sync.RWMutex{}
|
lock = sync.RWMutex{}
|
||||||
TEMPLATECACHE = fmt.Sprintf("template_cache_%d", pid)
|
TEMPLATECACHE = fmt.Sprintf("template_cache_%s", getPID())
|
||||||
TOGGLECACHE = fmt.Sprintf("toggle_cache_%d", pid)
|
TOGGLECACHE = fmt.Sprintf("toggle_cache_%s", getPID())
|
||||||
)
|
)
|
||||||
|
|
||||||
type Flags struct {
|
type Flags struct {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
export POSH_THEME=::CONFIG::
|
export POSH_THEME=::CONFIG::
|
||||||
export POWERLINE_COMMAND="oh-my-posh"
|
export POWERLINE_COMMAND="oh-my-posh"
|
||||||
|
export POSH_PID=$$
|
||||||
export CONDA_PROMPT_MODIFIER=false
|
export CONDA_PROMPT_MODIFIER=false
|
||||||
omp_start_time=""
|
omp_start_time=""
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
set --export POSH_THEME ::CONFIG::
|
set --export POSH_THEME ::CONFIG::
|
||||||
set --global POWERLINE_COMMAND "oh-my-posh"
|
set --global POWERLINE_COMMAND "oh-my-posh"
|
||||||
|
set --global POSH_PID $fish_pid
|
||||||
set --global CONDA_PROMPT_MODIFIER false
|
set --global CONDA_PROMPT_MODIFIER false
|
||||||
set --global omp_tooltip_prompt ""
|
set --global omp_tooltip_prompt ""
|
||||||
set --global has_omp_tooltip false
|
set --global has_omp_tooltip false
|
||||||
|
|
|
@ -2,6 +2,7 @@ export-env {
|
||||||
let-env POWERLINE_COMMAND = 'oh-my-posh'
|
let-env POWERLINE_COMMAND = 'oh-my-posh'
|
||||||
let-env POSH_THEME = ::CONFIG::
|
let-env POSH_THEME = ::CONFIG::
|
||||||
let-env PROMPT_INDICATOR = ""
|
let-env PROMPT_INDICATOR = ""
|
||||||
|
let-env POSH_PID = (random uuid)
|
||||||
# By default displays the right prompt on the first line
|
# By default displays the right prompt on the first line
|
||||||
# making it annoying when you have a multiline prompt
|
# making it annoying when you have a multiline prompt
|
||||||
# making the behavior different compared to other shells
|
# making the behavior different compared to other shells
|
||||||
|
|
|
@ -21,6 +21,7 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
||||||
$script:PSVersion = $PSVersionTable.PSVersion.ToString()
|
$script:PSVersion = $PSVersionTable.PSVersion.ToString()
|
||||||
$script:TransientPrompt = $false
|
$script:TransientPrompt = $false
|
||||||
$env:POWERLINE_COMMAND = "oh-my-posh"
|
$env:POWERLINE_COMMAND = "oh-my-posh"
|
||||||
|
$env:POSH_PID = $PID
|
||||||
$env:CONDA_PROMPT_MODIFIER = $false
|
$env:CONDA_PROMPT_MODIFIER = $false
|
||||||
if ((::CONFIG:: -ne '') -and (Test-Path -LiteralPath ::CONFIG::)) {
|
if ((::CONFIG:: -ne '') -and (Test-Path -LiteralPath ::CONFIG::)) {
|
||||||
$env:POSH_THEME = (Resolve-Path -Path ::CONFIG::).ProviderPath
|
$env:POSH_THEME = (Resolve-Path -Path ::CONFIG::).ProviderPath
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
export POSH_THEME=::CONFIG::
|
export POSH_THEME=::CONFIG::
|
||||||
|
export POSH_PID=$$
|
||||||
export POWERLINE_COMMAND="oh-my-posh"
|
export POWERLINE_COMMAND="oh-my-posh"
|
||||||
export CONDA_PROMPT_MODIFIER=false
|
export CONDA_PROMPT_MODIFIER=false
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue