JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.01k stars 2.37k forks source link

Prompt display only 1 line with tcsh #5105

Closed tradjincal closed 3 months ago

tradjincal commented 3 months ago

Code of Conduct

What happened?

Hello, There is only one line with my prompt in a tcsh shell. I tried the same config with bash and it work perfectly fine.

image

Theme

#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json

version = 2
final_space = true
console_title_template = '{{ .Folder }} @ {{ .HostName }}'

[[blocks]]
  type = 'prompt'
  alignment = 'left'
  newline = true

  [[blocks.segments]]
    type = 'path'
    style = 'plain'
    background = 'transparent'
    foreground = 'blue'
    template = '{{ .Path }}'

    [blocks.segments.properties]
      style = 'full'

  [[blocks.segments]]
    type = 'git'
    style = 'plain'
    foreground = 'p:grey'
    background = 'transparent'
    template = ' {{ .HEAD }}'

    [blocks.segments.properties]
      branch_icon = ' '
      commit_icon = '@'
      fetch_status = true

[[blocks]]
  type = 'rprompt'
  overflow = 'hidden'

  [[blocks.segments]]
    type = 'executiontime'
    style = 'plain'
    foreground = 'yellow'
    background = 'transparent'
    template = '{{ .FormattedMs }}'

    [blocks.segments.properties]
      threshold = 5000

[[blocks]]
  type = 'prompt'
  alignment = 'left'
  newline = true

  [[blocks.segments]]
    type = 'text'
    style = 'plain'
    foreground_templates = [
      "{{if gt .Code 0}}red{{end}}",
      "{{if eq .Code 0}}magenta{{end}}",
    ]
    background = 'transparent'
    template = '❯'

[transient_prompt]
  foreground_templates = [
    "{{if gt .Code 0}}red{{end}}",
    "{{if eq .Code 0}}magenta{{end}}",
  ]
  background = 'transparent'
  template = '❯ '

[secondary_prompt]
  foreground = 'magenta'
  background = 'transparent'
  template = '❯❯ '

What OS are you seeing the problem on?

Linux

Which shell are you using?

tcsh

Log output

~oh-my-posh debug --plain

Version: 21.11.0

Shell: csh

Prompt:

~
❯ 

Segments:

ConsoleTitle(true)                         -   1 ms
Path(true)                                 -   0 ms
Git(false)                                 -   0 ms
Executiontime(false)                       -   0 ms
Text(true)                                 -   0 ms

Run duration: 18.035698ms

Cache path: /home/pchevallay/.cache/oh-my-posh

Config path: /home/pchevallay/.config/ohmyposh/theme.toml

Logs:

[DEBUG] 08:33:51.751 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.751 shell.go:Getenv(TERM_PROGRAM) - 200.152µs
[DEBUG] 08:33:51.751 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.751 shell.go:Getenv(OMP_CACHE_DIR) - 15.054µs
[DEBUG] 08:33:51.751 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.751 shell.go:Getenv(XDG_CACHE_HOME) - 6.853µs
[TRACE] 08:33:51.751 shell_unix.go:CachePath() - 88.922µs
[DEBUG] 08:33:51.756 shell.go:Getenv:326 → /home/pchevallay/.config/ohmyposh/theme.toml
[TRACE] 08:33:51.756 shell.go:Getenv(POSH_THEME) - 31.222µs
[DEBUG] 08:33:51.756 shell_unix.go:Platform:87 → centos
[TRACE] 08:33:51.756 shell.go:resolveConfigPath() - 62.534µs
[TRACE] 08:33:51.756 shell.go:Init() - 5.846453ms
[TRACE] 08:33:51.756 shell.go:Flags() - 163ns
[TRACE] 08:33:51.757 config.go:loadConfig() - 880.104µs
[TRACE] 08:33:51.757 shell.go:Flags() - 184ns
[DEBUG] 08:33:51.757 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.757 shell.go:Getenv(OMP_CACHE_DISABLED) - 15.112µs
[DEBUG] 08:33:51.757 shell.go:Shell:601 → no shell name provided in flags, trying to detect it
[DEBUG] 08:33:51.759 shell.go:Shell:609 → process name: csh
[TRACE] 08:33:51.759 shell.go:Shell() - 1.837304ms
[DEBUG] 08:33:51.759 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.759 shell.go:Getenv(POSH_SHELL_VERSION) - 8.954µs
[DEBUG] 08:33:51.759 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 08:33:51.759 text.go:Render:72 → Rendering template: {{ .Folder }} @ {{ .HostName }}
[TRACE] 08:33:51.760 shell_unix.go:Root() - 2.696µs
[TRACE] 08:33:51.760 shell.go:Shell() - 278ns
[TRACE] 08:33:51.760 shell.go:StatusCodes() - 161ns
[DEBUG] 08:33:51.760 shell_unix.go:IsWsl:35 → false
[TRACE] 08:33:51.760 shell_unix.go:IsWsl() - 15.616µs
[DEBUG] 08:33:51.760 shell.go:TemplateCache:782 → environment: [XDG_SESSION_ID=1 OSTYPE=linux LD_LIBRARY_PATH=/tools/gnu/dv_eng/tmux/3.3a/lib:/tools/gnu/tclsh/rhel7/8.6.6/lib:/lib:/lib64:/tools/gnu/tclsh/rhel7/8.5.19/lib:/tools/gnu/python/3.6.0/lib QTLIB=/usr/lib64/qt-3.3/lib COLORTERM=truecolor GNOME_KEYRING_CONTROL=/home/pchevallay/.cache/keyring-4IVSN2 GNOME_TERMINAL_SERVICE=:1.68 GNOME_DESKTOP_SESSION_ID=this-is-deprecated MODULE_VERSION_STACK=3.2.10 LOGNAME=pchevallay MODULESHOME=/tools/gnu/modules/3.2.10/Modules/3.2.10 MODULERCFILE=/tools/cad/conf/modulefiles/modules.rc TDK_LSF_CONFIG=10.1 MACHTYPE=x86_64 SHELL=/bin/csh SYSVER=RH7 PATH=/tools/gnu/git/2.27.0/bin:/tools/gnu/dv_eng//yq/4.43.1/bin:/tools/gnu/dv_eng/tmux/3.3a/bin:/tools/gnu/dv_eng/go/1.22.0/bin:/tools/gnu/dv_eng/neovim/0.9.5/bin:/tools/gnu/dv_eng/ncdu/2.3/bin:/tools/gnu/dv_eng/htop/3.3.0/bin:/home/pchevallay/tools/cs7/starship:/home/pchevallay/tools/cs7/ohmyposh:/home/pchevallay/scripts:/home/pchevallay/.local/bin:/tools/gnu/nedit/5.7.1/bin:/tools/gnu/tkdiff/rhel6/4.2/bin:/tools/gnu/tclsh/rhel7/8.6.6/bin:/tools/lsf/10.1/linux3.10-glibc2.17-x86_64/etc:/tools/lsf/10.1/linux3.10-glibc2.17-x86_64/bin:/usr/lib64/qt-3.3/bin:/usr/NX/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/tools/gnu/python/3.6.0/bin:/tools/cad/bin:/bin:/tools/cad/bin:/bin MODULE_VERSION=3.2.10 XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0 XDG_MENU_PREFIX=gnome- XAUTHORITY=/var/run/lightdm/pchevallay/xauthority XDG_SESSION_DESKTOP=gnome HOST=ussjc-he022 GDMSESSION=gnome LESSOPEN=||/usr/bin/lesspipe.sh %s VENDOR=unknown QT_IM_MODULE=ibus _LMFILES_=/tools/cad/conf/modulefiles/cadenv/aliases:/tools/cad/conf/modulefiles/cadenv/silent:/tools/cad/conf/modulefiles/lsf/10.1:/tools/cad/conf/modulefiles/gnu/tclsh/8.6.6:/tools/cad/conf/modulefiles/gnu/python/3.6.0:/tools/cad/conf/modulefiles/gnu/tkdiff/4.2.0:/tools/cad/conf/modulefiles/gnu/nedit/5.7.1:/tools/cad/conf/modulefiles/cadenv/rh7p:/tools/cad/conf/modulefiles/cadenv/common:/tools/gnu/dv_eng/.modulefiles/dv_eng/htop/3.3.0:/tools/gnu/dv_eng/.modulefiles/dv_eng/ncdu/2.3:/tools/gnu/dv_eng/.modulefiles/dv_eng/neovim/0.9.5:/tools/gnu/dv_eng/.modulefiles/dv_eng/go/1.22.0:/tools/gnu/dv_eng/.modulefiles/dv_eng/tmux/3.3a:/tools/gnu/dv_eng/.modulefiles/dv_eng/yq/4.43.1:/tools/cad/conf/modulefiles/gnu/git/2.27.0 QT_GRAPHICSSYSTEM_CHECKED=1 HOSTTYPE=x86_64-linux MAIL=/var/spool/mail/pchevallay XDG_RUNTIME_DIR=/run/user/20229 MODULEPATH=/tools/gnu/dv_eng/.modulefiles:/home/pchevallay/tools/.modulefiles/:/tools/cad/conf/modulefiles NO_AT_BRIDGE=1 DESKTOP_SESSION=gnome CDS_USE_XVFB=1 PROJECT_DIR=cdb NXDIR=/usr/NX USER=pchevallay QTDIR=/usr/lib64/qt-3.3 PWD=/home/pchevallay VTE_VERSION=5204 QTINC=/usr/lib64/qt-3.3/include HOME=/home/pchevallay XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat1 LOADEDMODULES=cadenv/aliases:cadenv/silent:lsf/10.1:gnu/tclsh/8.6.6:gnu/python/3.6.0:gnu/tkdiff/4.2.0:gnu/nedit/5.7.1:cadenv/rh7p:cadenv/common:dv_eng/htop/3.3.0:dv_eng/ncdu/2.3:dv_eng/neovim/0.9.5:dv_eng/go/1.22.0:dv_eng/tmux/3.3a:dv_eng/yq/4.43.1:gnu/git/2.27.0 LANG=en_US.utf8 LSF_BINDIR=/tools/lsf/10.1/linux3.10-glibc2.17-x86_64/bin GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/31e1fd72_c6a2_4bc8_aaa7_6b26ed1281e3 SHLVL=2 W3264_NOWARN_UNSUPPORTED_CENTOS=1 GDM_LANG=en_US.utf8 TERM=xterm-256color XDG_SESSION_TYPE=x11 DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-EdT2PYMo4i,guid=e651f48b68d77b298efcc7dd664216f6 XDG_CURRENT_DESKTOP=GNOME SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/11257,unix/unix:/tmp/.ICE-unix/11257 MANPATH=/tools/lsf/10.1/linux3.10-glibc2.17-x86_64/man:/usr/share/man LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45: LD_RUN_PATH=/tools/gnu/dv_eng/tmux/3.3a/lib:/tools/gnu/dv_eng/go/1.22.0/lib:/tools/gnu/dv_eng/neovim/0.9.5/lib GOROOT=/tools/gnu/dv_eng/go/1.22.0 PF_INFO=os kernel uptime memory de shell palette PF_SEP=: PF_COLOR=1 PF_ASCII=linux POWERLINE_COMMAND=oh-my-posh POSH_THEME=/home/pchevallay/.config/ohmyposh/theme.toml POSH_SHELL_VERSION=]
[TRACE] 08:33:51.760 shell.go:GOOS() - 304ns
[DEBUG] 08:33:51.760 shell.go:Pwd:356 → /home/pchevallay
[TRACE] 08:33:51.760 shell.go:Pwd() - 51.485µs
[DEBUG] 08:33:51.760 shell_unix.go:IsWsl:35 → false
[TRACE] 08:33:51.761 shell_unix.go:IsWsl() - 47.005µs
[TRACE] 08:33:51.761 shell.go:GOOS() - 137ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 83ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 77ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 77ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 84ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 83ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 87ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 80ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 84ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 81ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 84ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 90ns
[DEBUG] 08:33:51.761 shell.go:User:494 → pchevallay
[TRACE] 08:33:51.761 shell.go:User() - 7.939µs
[DEBUG] 08:33:51.761 shell.go:Host:511 → ussjc-he022
[TRACE] 08:33:51.761 shell.go:Host() - 26.304µs
[TRACE] 08:33:51.761 shell.go:GOOS() - 97ns
[DEBUG] 08:33:51.761 shell_unix.go:Platform:87 → centos
[DEBUG] 08:33:51.761 shell.go:Getenv:326 → 2
[TRACE] 08:33:51.761 shell.go:Getenv(SHLVL) - 7.627µs
[TRACE] 08:33:51.761 shell.go:TemplateCache() - 532.158µs
[DEBUG] 08:33:51.761 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.761 shell.go:Getenv(POSH_CURSOR_LINE) - 7.718µs
[DEBUG] 08:33:51.761 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.761 shell.go:Getenv(POSH_CURSOR_COLUMN) - 5.643µs
[TRACE] 08:33:51.761 shell.go:Flags() - 147ns
[TRACE] 08:33:51.761 shell.go:Flags() - 87ns
[TRACE] 08:33:51.761 shell.go:Shell() - 114ns
[TRACE] 08:33:51.761 shell.go:Shell() - 84ns
[TRACE] 08:33:51.761 shell.go:Flags() - 130ns
[TRACE] 08:33:51.761 shell.go:Pwd() - 414ns
[TRACE] 08:33:51.761 shell.go:Flags() - 585ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 110ns
[DEBUG] 08:33:51.761 segment.go:SetEnabled:557 → Segment: Git
[DEBUG] 08:33:51.761 shell_unix.go:IsWsl:35 → false
[TRACE] 08:33:51.761 shell_unix.go:IsWsl() - 11.885µs
[TRACE] 08:33:51.761 shell_unix.go:IsWsl2() - 41.99µs
[TRACE] 08:33:51.761 shell.go:Pwd() - 588ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 254ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 147ns
[DEBUG] 08:33:51.761 segment.go:SetEnabled:557 → Segment: Path
[TRACE] 08:33:51.761 shell.go:Pwd() - 284ns
[TRACE] 08:33:51.761 shell.go:Shell() - 274ns
[TRACE] 08:33:51.761 shell.go:Shell() - 80ns
[DEBUG] 08:33:51.761 shell.go:CommandPath:553 → /tools/gnu/git/2.27.0/bin/git
[TRACE] 08:33:51.761 shell.go:CommandPath(git) - 77.609µs
[TRACE] 08:33:51.761 shell.go:HasCommand(git) - 86.006µs
[TRACE] 08:33:51.761 shell.go:Pwd() - 314ns
[DEBUG] 08:33:51.761 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 08:33:51.761 properties.go:GetString:28 → 
[DEBUG] 08:33:51.761 properties.go:GetString:28 → 
[TRACE] 08:33:51.761 shell.go:GOOS() - 184ns
[DEBUG] 08:33:51.761 properties.go:GetString:28 → ~
[ERROR] 08:33:51.761 shell.go:HasParentFilePath:697 → stat .git: no such file or directory
[TRACE] 08:33:51.761 shell.go:HasParentFilePath(.git) - 220.338µs
[DEBUG] 08:33:51.761 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[DEBUG] 08:33:51.761 properties.go:GetBool:22 → fetch_bare_info: false
[TRACE] 08:33:51.761 shell.go:PathSeparator() - 201ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 157ns
[TRACE] 08:33:51.761 shell.go:GOOS() - 83ns
[TRACE] 08:33:51.762 shell.go:GOOS() - 248ns
[TRACE] 08:33:51.762 shell.go:GOOS() - 97ns
[TRACE] 08:33:51.762 shell.go:PathSeparator() - 80ns
[TRACE] 08:33:51.762 shell.go:PathSeparator() - 83ns
[TRACE] 08:33:51.762 shell.go:GOOS() - 107ns
[TRACE] 08:33:51.762 shell.go:GOOS() - 86ns
[TRACE] 08:33:51.762 shell.go:PathSeparator() - 90ns
[TRACE] 08:33:51.762 shell.go:GOOS() - 87ns
[TRACE] 08:33:51.762 shell.go:GOOS() - 83ns
[TRACE] 08:33:51.762 shell.go:PathSeparator() - 90ns
[TRACE] 08:33:51.762 shell.go:GOOS() - 93ns
[TRACE] 08:33:51.762 shell.go:GOOS() - 87ns
[TRACE] 08:33:51.762 shell.go:PathSeparator() - 80ns
[DEBUG] 08:33:51.762 properties.go:GetString:28 → NO DATA
[TRACE] 08:33:51.762 shell.go:PathSeparator() - 87ns
[TRACE] 08:33:51.762 shell.go:Pwd() - 277ns
[TRACE] 08:33:51.762 shell.go:TemplateCache() - 554ns
[TRACE] 08:33:51.762 shell.go:StackCount() - 258ns
[TRACE] 08:33:51.762 shell_unix.go:DirIsWritable(/home/pchevallay) - 19.882µs
[TRACE] 08:33:51.762 shell.go:TemplateCache() - 197ns
[DEBUG] 08:33:51.762 text.go:Render:72 → Rendering template: {{ .Path }}
[TRACE] 08:33:51.763 shell.go:TemplateCache() - 742ns
[DEBUG] 08:33:51.763 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.763 shell.go:Getenv(TERM_PROGRAM) - 11.897µs
[DEBUG] 08:33:51.763 text.go:Render:72 → Rendering template: plain
[DEBUG] 08:33:51.763 text.go:Render:72 → Rendering template: plain
[TRACE] 08:33:51.763 shell.go:Shell() - 414ns
[TRACE] 08:33:51.763 shell.go:Shell() - 84ns
[TRACE] 08:33:51.763 shell.go:Shell() - 83ns
[TRACE] 08:33:51.763 shell.go:Shell() - 84ns
[TRACE] 08:33:51.763 shell.go:Flags() - 160ns
[TRACE] 08:33:51.763 shell.go:Pwd() - 304ns
[TRACE] 08:33:51.763 shell.go:GOOS() - 120ns
[DEBUG] 08:33:51.763 segment.go:SetEnabled:557 → Segment: Executiontime
[DEBUG] 08:33:51.763 properties.go:GetBool:22 → always_enabled: false
[TRACE] 08:33:51.763 shell.go:ExecutionTime() - 207ns
[DEBUG] 08:33:51.763 properties.go:GetFloat64:34 → threshold: 5000.000000
[TRACE] 08:33:51.763 shell.go:Shell() - 197ns
[TRACE] 08:33:51.763 shell.go:Shell() - 84ns
[TRACE] 08:33:51.763 shell.go:Shell() - 90ns
[TRACE] 08:33:51.763 shell.go:Shell() - 80ns
[TRACE] 08:33:51.763 shell.go:Flags() - 150ns
[TRACE] 08:33:51.763 shell.go:Pwd() - 157ns
[TRACE] 08:33:51.763 shell.go:GOOS() - 117ns
[DEBUG] 08:33:51.763 segment.go:SetEnabled:557 → Segment: Text
[TRACE] 08:33:51.763 shell.go:TemplateCache() - 424ns
[DEBUG] 08:33:51.764 text.go:Render:72 → Rendering template: ❯
[DEBUG] 08:33:51.764 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.764 shell.go:Getenv(TERM_PROGRAM) - 24.684µs
[DEBUG] 08:33:51.764 text.go:Render:72 → Rendering template: {{if gt .Code 0}}red{{end}}
[TRACE] 08:33:51.767 shell.go:TemplateCache() - 1.156µs
[DEBUG] 08:33:51.767 text.go:Render:72 → Rendering template: {{if eq .Code 0}}magenta{{end}}
[TRACE] 08:33:51.768 shell.go:TemplateCache() - 812ns
[DEBUG] 08:33:51.768 text.go:Render:72 → Rendering template: plain
[TRACE] 08:33:51.768 shell.go:Shell() - 484ns
[TRACE] 08:33:51.768 shell.go:Shell() - 87ns
[TRACE] 08:33:51.768 shell.go:Flags() - 164ns
[TRACE] 08:33:51.768 shell.go:Shell() - 81ns
[TRACE] 08:33:51.768 shell.go:Shell() - 84ns
[DEBUG] 08:33:51.769 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.769 shell.go:Getenv(OMP_CACHE_DIR) - 11.136µs
[DEBUG] 08:33:51.769 shell.go:Getenv:326 → NO DATA
[TRACE] 08:33:51.769 shell.go:Getenv(XDG_CACHE_HOME) - 6.358µs
[TRACE] 08:33:51.769 shell_unix.go:CachePath() - 67.275µs
[TRACE] 08:33:51.769 shell.go:Flags() - 104ns
JanDeDobbeleer commented 3 months ago

Reading something interesting about this on the interwebs:

the \n character works but it requires that ' ' space before it, don't know why.

We currently only print \n without a space. Will have a look at if this is actually true or not. You could try adding a text segment with that value where you expect the newline as a test.

JanDeDobbeleer commented 3 months ago

Confirmed. This works and requires a huge facepalm.

#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json

version = 2
final_space = true
console_title_template = '{{ .Folder }} @ {{ .HostName }}'

[[blocks]]
  type = 'prompt'
  alignment = 'left'
  newline = true

  [[blocks.segments]]
    type = 'path'
    style = 'plain'
    background = 'transparent'
    foreground = 'blue'
    template = '{{ .Path }}'

    [blocks.segments.properties]
      style = 'full'

  [[blocks.segments]]
    type = 'git'
    style = 'plain'
    foreground = 'p:grey'
    background = 'transparent'
    template = ' {{ .HEAD }}'

    [blocks.segments.properties]
      branch_icon = ' '
      commit_icon = '@'
      fetch_status = true

[[blocks]]
  type = 'rprompt'
  overflow = 'hidden'

  [[blocks.segments]]
    type = 'executiontime'
    style = 'plain'
    foreground = 'yellow'
    background = 'transparent'
    template = '{{ .FormattedMs }}'

    [blocks.segments.properties]
      threshold = 5000

[[blocks]]
  type = 'prompt'
  alignment = 'left'

  [[blocks.segments]]
    type = 'text'
    style = 'plain'
    foreground_templates = [
      "{{if gt .Code 0}}red{{end}}",
      "{{if eq .Code 0}}magenta{{end}}",
    ]
    background = 'transparent'
    template = ' \n'

  [[blocks.segments]]
    type = 'text'
    style = 'plain'
    foreground_templates = [
      "{{if gt .Code 0}}red{{end}}",
      "{{if eq .Code 0}}magenta{{end}}",
    ]
    background = 'transparent'
    template = '❯'

[transient_prompt]
  foreground_templates = [
    "{{if gt .Code 0}}red{{end}}",
    "{{if eq .Code 0}}magenta{{end}}",
  ]
  background = 'transparent'
  template = '❯ '

[secondary_prompt]
  foreground = 'magenta'
  background = 'transparent'
  template = '❯❯ '
tradjincal commented 3 months ago

It works perfectly now. Thanks for the support.

github-actions[bot] commented 2 weeks ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.