fix(fish): correctly export environment variables

This commit is contained in:
Jan De Dobbeleer 2024-07-25 14:27:24 +02:00 committed by Jan De Dobbeleer
parent 51c3f9e0eb
commit 07655211f8
2 changed files with 9 additions and 5 deletions

4
src/cache/cache.go vendored
View file

@ -5,6 +5,8 @@ import (
"os"
"strconv"
"time"
"github.com/jandedobbeleer/oh-my-posh/src/log"
)
type Cache interface {
@ -30,8 +32,10 @@ var SessionFileName = fmt.Sprintf("%s.%s", FileName, pid())
func pid() string {
pid := os.Getenv("POSH_PID")
if len(pid) == 0 {
log.Debug("POSH_PID not set, using process pid")
pid = strconv.Itoa(os.Getppid())
}
return pid
}

View file

@ -1,8 +1,8 @@
set --export POSH_THEME ::CONFIG::
set --export POSH_SHELL_VERSION $FISH_VERSION
set --global POWERLINE_COMMAND oh-my-posh
set --global POSH_PID $fish_pid
set --global CONDA_PROMPT_MODIFIER false
set --global --export POSH_THEME ::CONFIG::
set --global --export POSH_SHELL_VERSION $FISH_VERSION
set --global --export POWERLINE_COMMAND oh-my-posh
set --global --export POSH_PID $fish_pid
set --global --export CONDA_PROMPT_MODIFIER false
set --global _omp_tooltip_command ''
set --global _omp_current_rprompt ''
set --global _omp_transient false