JanDeDobbeleer / oh-my-posh

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

Command line input is not kept when typing while shell startup #5072

Closed Programie closed 2 months ago

Programie commented 2 months ago

Code of Conduct

What happened?

Starting up my shell usually takes around 1 to 2 seconds. My habit is to already start typing the command I want to execute while the shell starts up whenever I open a new terminal tab or connect to a server via SSH. But in case of oh-my-posh, the part already entered while the shell starts up is not kept.

This clearly looks like an issue with oh-my-posh because I can't reproduce the issue whenever I remove the invocation of oh-my-posh from my shell's rc file.

This seems to be related to #3446.

Theme

# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json

version: 2

final_space: true

blocks:
- type: prompt
  alignment: left
  newline: true
  segments:
  - type: text
    style: plain
    foreground: "p:white"
    template: "\u256d\u2500"

  - type: os
    style: diamond
    leading_diamond: "\ue0b6"
    foreground: "p:yellow"
    background: "p:black"

  - type: session
    style: powerline
    powerline_symbol: "\ue0b0"
    foreground_templates:
    - "{{ if .Root }}p:white{{ else }}p:yellow{{ end }}"
    background_templates:
    - "{{ if .Root }}p:red{{ else }}p:black{{ end }}"
    template: "{{ if .Root }} {{ end }}{{ if .SSHSession }}\ueba9 {{ end }}{{ .UserName }}@{{ .HostName }} "

  - type: path
    style: powerline
    powerline_symbol: "\ue0b0"
    foreground_templates:
    - "{{ if .Writable }}p:black{{ else }}p:white{{ end }}"
    background_templates:
    - "{{ if .Writable }}p:blue{{ else }}p:red{{ end }}"
    template: " \uf07b {{ .Path }} "
    properties:
      style: full

  - type: git
    style: powerline
    powerline_symbol: "\ue0b0"
    foreground: p:black
    foreground_templates:
    - "{{ if or (.Working.Changed) (.Staging.Changed) }}p:black{{ end }}"
    - "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:white{{ end }}"
    background: p:green
    background_templates:
    - "{{ if or (.Working.Changed) (.Staging.Changed) }}p:yellow{{ end }}"
    - "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:red{{ end }}"
    - "{{ if gt .Ahead 0 }}p:orange{{ end }}"
    - "{{ if gt .Behind 0 }}p:orange{{ end }}"
    template: " {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }} "
    properties:
      branch_max_length: 25
      fetch_status: true
      fetch_upstream_icon: true

- type: prompt
  alignment: right
  segments:
  - type: status
    style: powerline
    invert_powerline: true
    powerline_symbol: "\ue0b2"
    foreground: p:white
    background: p:red
    template: " {{ .Code }} "

  - type: executiontime
    style: powerline
    invert_powerline: true
    powerline_symbol: "\ue0b2"
    foreground: p:white
    background: p:black
    template: " \uf017 {{ .FormattedMs }} "
    properties:
      threshold: 2000

  - type: python
    style: powerline
    invert_powerline: true
    powerline_symbol: "\ue0b2"
    foreground: p:yellow
    background: p:black
    template: "\ue235 {{ .Full }} ({{ .Venv }})"

  - type: time
    style: diamond
    invert_powerline: true
    leading_diamond: "\ue0b2"
    trailing_diamond: "\ue0b4"
    foreground: p:white
    background: p:black

- type: prompt
  alignment: left
  newline: true
  segments:
    - type: text
      style: plain
      foreground: "p:white"
      template: "\u2570\u2500#"

#transient_prompt:
#  template: "{{ now | date \"15:04:05\" }} {{ .PWD }} # "

secondary_prompt:
  background: "transparent"
  foreground: p:white
  template: "-> "

palette:
  black: "#262626"
  gray: "#444444"
  blue: "#4B95E9"
  green: "#4caf50"
  orange: "#F07623"
  red: "#dc291e"
  white: "#E0DEF4"
  yellow: "#F3AE35"

What OS are you seeing the problem on?

Linux

Which shell are you using?

zsh

Log output

Version: 21.5.0

Shell: zsh (5.9)

Prompt:

╭─  programie@minty   ~                                                                                                                                                                             21:23:20 
╰─#

Segments:

ConsoleTitle(false)                        -   0 ms
Text(true)                                 -   0 ms
Os(true)                                   -   0 ms
Session(true)                              -   1 ms
Path(true)                                 -   0 ms
Git(false)                                 -   0 ms
Status(false)                              -   0 ms
Executiontime(false)                       -   0 ms
Python(false)                              -   0 ms
Time(true)                                 -   0 ms
Text(true)                                 -   0 ms

Run duration: 15.907444ms

Cache path: /home/programie/snap/alacritty/common/.cache/oh-my-posh

Config path: /home/programie/.config/ohmyposh.yaml

Logs:

[DEBUG] 21:23:20.026 shell.go:Getenv:326 → tmux
[TRACE] 21:23:20.026 shell.go:Getenv(TERM_PROGRAM) - 82.695µs
[DEBUG] 21:23:20.026 shell.go:Getenv:326 → NO DATA
[TRACE] 21:23:20.026 shell.go:Getenv(OMP_CACHE_DIR) - 4.673µs
[DEBUG] 21:23:20.026 shell.go:Getenv:326 → /home/programie/snap/alacritty/common/.cache
[TRACE] 21:23:20.026 shell.go:Getenv(XDG_CACHE_HOME) - 4.683µs
[TRACE] 21:23:20.026 shell_unix.go:CachePath() - 37.44µs
[DEBUG] 21:23:20.026 shell.go:Getenv:326 → /home/programie/.config/ohmyposh.yaml
[TRACE] 21:23:20.026 shell.go:Getenv(POSH_THEME) - 14.305µs
[DEBUG] 21:23:20.026 shell_unix.go:Platform:87 → ubuntu
[TRACE] 21:23:20.026 shell.go:resolveConfigPath() - 33.772µs
[TRACE] 21:23:20.027 shell.go:Init() - 979.319µs
[TRACE] 21:23:20.027 shell.go:Flags() - 97ns
[TRACE] 21:23:20.033 config.go:loadConfig() - 5.989512ms
[TRACE] 21:23:20.033 shell.go:Flags() - 151ns
[DEBUG] 21:23:20.033 shell.go:Getenv:326 → NO DATA
[TRACE] 21:23:20.033 shell.go:Getenv(OMP_CACHE_DISABLED) - 7.588µs
[DEBUG] 21:23:20.033 shell.go:Shell:601 → no shell name provided in flags, trying to detect it
[DEBUG] 21:23:20.034 shell.go:Shell:609 → process name: zsh
[TRACE] 21:23:20.034 shell.go:Shell() - 1.468952ms
[DEBUG] 21:23:20.034 shell.go:Getenv:326 → 5.9
[TRACE] 21:23:20.034 shell.go:Getenv(POSH_SHELL_VERSION) - 8.68µs
[DEBUG] 21:23:20.034 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 21:23:20.034 text.go:Render:71 → Rendering template:
[DEBUG] 21:23:20.034 shell.go:Getenv:326 → 49
[TRACE] 21:23:20.034 shell.go:Getenv(POSH_CURSOR_LINE) - 6.251µs
[DEBUG] 21:23:20.034 shell.go:Getenv:326 → 1
[TRACE] 21:23:20.034 shell.go:Getenv(POSH_CURSOR_COLUMN) - 5.207µs
[TRACE] 21:23:20.034 shell.go:Flags() - 77ns
[TRACE] 21:23:20.034 shell.go:Flags() - 70ns
[TRACE] 21:23:20.034 shell.go:Shell() - 113ns
[TRACE] 21:23:20.034 shell.go:Shell() - 83ns
[TRACE] 21:23:20.034 shell.go:Flags() - 77ns
[TRACE] 21:23:20.034 shell.go:GOOS() - 183ns
[TRACE] 21:23:20.034 shell.go:Flags() - 230ns
[DEBUG] 21:23:20.034 shell.go:Pwd:356 → /home/programie
[TRACE] 21:23:20.034 shell.go:Pwd() - 55.301µs
[TRACE] 21:23:20.034 shell.go:Flags() - 160ns
[TRACE] 21:23:20.034 shell.go:Flags() - 190ns
[TRACE] 21:23:20.034 shell.go:GOOS() - 98ns
[DEBUG] 21:23:20.034 segment.go:SetEnabled:536 → Segment: Git
[TRACE] 21:23:20.034 shell.go:Pwd() - 330ns
[TRACE] 21:23:20.034 shell.go:Flags() - 201ns
[TRACE] 21:23:20.034 shell.go:GOOS() - 111ns
[TRACE] 21:23:20.034 shell.go:Pwd() - 243ns
[TRACE] 21:23:20.034 shell.go:Pwd() - 269ns
[DEBUG] 21:23:20.034 segment.go:SetEnabled:536 → Segment: Os
[TRACE] 21:23:20.034 shell.go:Pwd() - 152ns
[TRACE] 21:23:20.034 shell.go:GOOS() - 91ns
[DEBUG] 21:23:20.034 shell_unix.go:IsWsl:35 → false
[TRACE] 21:23:20.034 shell.go:GOOS() - 84ns
[TRACE] 21:23:20.034 shell.go:GOOS() - 80ns
[TRACE] 21:23:20.034 shell_unix.go:IsWsl() - 9.036µs
[DEBUG] 21:23:20.034 segment.go:SetEnabled:536 → Segment: Text
[DEBUG] 21:23:20.034 segment.go:SetEnabled:536 → Segment: Path
[TRACE] 21:23:20.034 shell.go:Pwd() - 69ns
[TRACE] 21:23:20.034 shell_unix.go:IsWsl2() - 15.927µs
[TRACE] 21:23:20.034 shell_unix.go:Root() - 1.439µs
[TRACE] 21:23:20.034 shell.go:Shell() - 141ns
[TRACE] 21:23:20.034 shell.go:Shell() - 72ns
[TRACE] 21:23:20.034 shell.go:GOOS() - 95ns
[TRACE] 21:23:20.034 shell.go:Shell() - 103ns
[DEBUG] 21:23:20.034 shell_unix.go:Platform:87 → ubuntu
[TRACE] 21:23:20.034 shell.go:Getenv(SSH_CONNECTION) - 8.184µs
[TRACE] 21:23:20.034 shell.go:StatusCodes() - 168ns
[DEBUG] 21:23:20.034 shell.go:Getenv:326 → NO DATA
[DEBUG] 21:23:20.034 shell_unix.go:IsWsl:35 → false
[TRACE] 21:23:20.034 shell.go:Getenv(SSH_CLIENT) - 6.879µs
[TRACE] 21:23:20.034 shell_unix.go:IsWsl() - 10.917µs
[DEBUG] 21:23:20.034 shell_unix.go:Platform:87 → ubuntu
[DEBUG] 21:23:20.034 properties.go:GetBool:22 → display_distro_name: false
[DEBUG] 21:23:20.034 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 21:23:20.034 properties.go:GetString:28 → 
[DEBUG] 21:23:20.034 properties.go:GetString:28 → 
[DEBUG] 21:23:20.034 properties.go:GetString:28 → 
[TRACE] 21:23:20.034 shell.go:GOOS() - 89ns
[DEBUG] 21:23:20.034 properties.go:GetString:28 → ~
[DEBUG] 21:23:20.034 shell.go:CommandPath:553 → /usr/bin/git
[DEBUG] 21:23:20.034 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 21:23:20.034 shell.go:CommandPath(git) - 86.125µs
[TRACE] 21:23:20.034 shell.go:PathSeparator() - 84ns
[TRACE] 21:23:20.034 shell.go:GOOS() - 41ns
[TRACE] 21:23:20.034 shell.go:HasCommand(git) - 94.29µs
[TRACE] 21:23:20.034 shell.go:GOOS() - 39ns
[TRACE] 21:23:20.034 shell.go:Pwd() - 203ns
[TRACE] 21:23:20.034 shell.go:GOOS() - 93ns
[ERROR] 21:23:20.034 shell.go:HasParentFilePath:697 → stat .git: no such file or directory
[TRACE] 21:23:20.034 shell.go:GOOS() - 42ns
[TRACE] 21:23:20.034 shell.go:PathSeparator() - 40ns
[TRACE] 21:23:20.034 shell.go:PathSeparator() - 42ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 40ns
[DEBUG] 21:23:20.034 shell.go:TemplateCache:782 → environment: [ALACRITTY_LOG=/tmp/Alacritty-95183.log ALACRITTY_SOCKET=/run/user/1000/Alacritty-:0-95183.sock ALACRITTY_WINDOW_ID=90177541 CLUTTER_IM_MODULE=ibus COLORTERM=truecolor DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DEFAULTS_PATH=/usr/share/gconf/plasma.default.path DESKTOP_SESSION=plasma DISPLAY=:0 FONTCONFIG_FILE=/snap/alacritty/130/etc/fonts/fonts.conf FONTCONFIG_PATH=/snap/alacritty/130/etc/fonts GDK_PIXBUF_MODULEDIR=/snap/alacritty/130/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders GDK_PIXBUF_MODULE_FILE=/home/programie/snap/alacritty/common/.cache/gdk-pixbuf-loaders.cache GIO_MODULE_DIR=/home/programie/snap/alacritty/common/.cache/gio-modules GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1 GSM_SKIP_SSH_AGENT_WORKAROUND=true GST_PLUGIN_PATH=/snap/alacritty/130/usr/lib/x86_64-linux-gnu/gstreamer-1.0 GST_PLUGIN_SCANNER=/snap/alacritty/130/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner GST_PLUGIN_SYSTEM_PATH=/snap/alacritty/130/usr/lib/x86_64-linux-gnu/gstreamer-1.0 GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/programie/.gtkrc-2.0:/home/programie/.config/gtkrc-2.0 GTK3_MODULES=xapp-gtk3-module GTK_IM_MODULE=ibus GTK_MODULES=gail:atk-bridge GTK_RC_FILES=/etc/gtk/gtkrc:/home/programie/.gtkrc:/home/programie/.config/gtkrc HOME=/home/programie IM_CONFIG_PHASE=1 INVOCATION_ID=1575b8bbc996465782cea4dacf7cf427 JOURNAL_STREAM=8:23707 KDE_APPLICATIONS_AS_SCOPE=1 KDE_FULL_SESSION=true KDE_SESSION_UID=1000 KDE_SESSION_VERSION=5 LANG=en_US.UTF-8 LC_ADDRESS=de_DE.UTF-8 LC_ALL=C.UTF-8 LC_COLLATE=de_DE.UTF-8 LC_IDENTIFICATION=de_DE.UTF-8 LC_MEASUREMENT=de_DE.UTF-8 LC_MONETARY=de_DE.UTF-8 LC_NAME=de_DE.UTF-8 LC_NUMERIC=de_DE.UTF-8 LC_PAPER=de_DE.UTF-8 LC_TELEPHONE=de_DE.UTF-8 LC_TIME=de_DE.UTF-8 LD_LIBRARY_PATH=/snap/alacritty/130/usr/lib/x86_64-linux-gnu/dri LIBGL_DRIVERS_PATH=/snap/alacritty/130/usr/lib/x86_64-linux-gnu/dri LIBVA_DRIVERS_PATH=/snap/alacritty/130/usr/lib/x86_64-linux-gnu/dri LOGNAME=programie MANAGERPID=2714 MANDATORY_PATH=/usr/share/gconf/plasma.mandatory.path MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/background.slice/plasma-kglobalaccel.service/memory.pressure MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA= OLDPWD=/home/programie PATH=/home/programie/.pyenv/shims:/home/programie/.pyenv/bin:/home/programie/.volta/bin:/home/programie/.zinit/polaris/bin:/home/programie/bin:/home/programie/.local/bin:/home/programie/git/Tools:/home/programie/git/Tools-Public:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin PWD=/home/programie QTWEBENGINE_DICTIONARIES_PATH=/usr/share/hunspell-bdic/ QT_ACCESSIBILITY=1 QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_IM_MODULE=ibus QT_SCREEN_SCALE_FACTORS=DVI-D-0=1;HDMI-0=1;DP-0=1;DP-1=1;DP-2=1;DP-3=1;DP-4=1;DP-5=1; SHELL=/usr/bin/zsh SHLVL=3 SNAP=/snap/alacritty/130 SNAP_ARCH=amd64 SNAP_COMMON=/var/snap/alacritty/common SNAP_CONTEXT=eQ-O5MXbZWtyuyN2aZMyiulV74lcsedEFbqKwSrSczCh2XvO0zEi SNAP_COOKIE=eQ-O5MXbZWtyuyN2aZMyiulV74lcsedEFbqKwSrSczCh2XvO0zEi SNAP_DATA=/var/snap/alacritty/130 SNAP_EUID=1000 SNAP_INSTANCE_KEY= SNAP_INSTANCE_NAME=alacritty SNAP_LAUNCHER_ARCH_TRIPLET=x86_64-linux-gnu SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void SNAP_NAME=alacritty SNAP_REAL_HOME=/home/programie SNAP_REEXEC= SNAP_REVISION=130 SNAP_UID=1000 SNAP_USER_COMMON=/home/programie/snap/alacritty/common SNAP_USER_DATA=/home/programie/snap/alacritty/130 SNAP_VERSION=0.13.2 SSH_AGENT_PID=2839 SSH_ASKPASS=/usr/bin/ksshaskpass SSH_AUTH_SOCK=/tmp/ssh-N8oLh34ESNMP/agent.2733 SYSTEMD_EXEC_PID=3056 TERM=xterm-256color TERM_PROGRAM=tmux TERM_PROGRAM_VERSION=3.4 TMUX=/tmp/tmux-1000/default,95548,0 TMUX_PANE=%2 TMUX_PLUGIN_MANAGER_PATH=/home/programie/.tmux/plugins/ USER=programie VDPAU_DRIVER_PATH=/usr/lib/x86_64-linux-gnu/vdpau/ WINDOWID=90177541 XAUTHORITY=/run/user/1000/.Xauthority XCURSOR_SIZE=24 XCURSOR_THEME=breeze_cursors XDG_CACHE_HOME=/home/programie/snap/alacritty/common/.cache XDG_CONFIG_DIRS=/home/programie/.config/kdedefaults:/etc/xdg/xdg-plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings XDG_CONFIG_HOME=/home/programie/.config XDG_CURRENT_DESKTOP=KDE XDG_DATA_DIRS=/usr/share/gnome:/home/programie/snap/alacritty/130/.local/share:/home/programie/snap/alacritty/130:/snap/alacritty/130/usr/share:/usr/share/plasma:/home/programie/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop XDG_DATA_HOME=/home/programie/.local/share XDG_RUNTIME_DIR=/run/user/1000 XDG_SEAT=seat0 XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 XDG_SESSION_CLASS=user XDG_SESSION_DESKTOP=KDE XDG_SESSION_ID=1 XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0 XDG_SESSION_TYPE=x11 XDG_VTNR=2 XKB_CONFIG_ROOT=/snap/alacritty/130/usr/share/X11/xkb XLOCALEDIR=/snap/alacritty/130/usr/share/X11/locale XMODIFIERS=@im=ibus _=/usr/local/bin/oh-my-posh __EGL_VENDOR_LIBRARY_DIRS=/snap/alacritty/130/etc/glvnd/egl_vendor.d:/snap/alacritty/130/usr/share/glvnd/egl_vendor.d DEBUGINFOD_URLS=https://debuginfod.ubuntu.com  LIBVIRT_DEFAULT_URI=qemu:///system MANPATH=:/opt/puppetlabs/puppet/share/man EDITOR=vim HISTSIZE=10000000 SAVEHIST=10000000 GIT_HOME=/home/programie/git SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 HISTFILE=/home/programie/Nextcloud/dotfiles/.zsh_history ZPFX=/home/programie/.zinit/polaris ZSH_CACHE_DIR=/home/programie/snap/alacritty/common/.cache/zinit PMSPEC=0uUpiPsf VOLTA_HOME=/home/programie/.volta PYENV_ROOT=/home/programie/.pyenv PYENV_SHELL=zsh POSH_THEME=/home/programie/.config/ohmyposh.yaml POSH_SHELL_VERSION=5.9 POSH_PID=96363 POWERLINE_COMMAND=oh-my-posh CONDA_PROMPT_MODIFIER=false POSH_PROMPT_COUNT=5 ZLE_RPROMPT_INDENT=0 POSH_CURSOR_LINE=49 POSH_CURSOR_COLUMN=1]
[TRACE] 21:23:20.035 shell.go:GOOS() - 62ns
[TRACE] 21:23:20.035 shell.go:PathSeparator() - 39ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 38ns
[DEBUG] 21:23:20.035 properties.go:GetBool:22 → fetch_bare_info: false
[TRACE] 21:23:20.035 shell.go:GOOS() - 62ns
[TRACE] 21:23:20.035 shell.go:PathSeparator() - 62ns
[DEBUG] 21:23:20.035 properties.go:GetString:28 → NO DATA
[TRACE] 21:23:20.035 shell.go:PathSeparator() - 68ns
[TRACE] 21:23:20.035 shell.go:Pwd() - 125ns
[DEBUG] 21:23:20.035 shell_unix.go:IsWsl:35 → false
[TRACE] 21:23:20.035 shell_unix.go:IsWsl() - 4.726µs
[TRACE] 21:23:20.035 shell.go:StackCount() - 117ns
[TRACE] 21:23:20.035 shell.go:Pwd() - 218ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 60ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 38ns
[TRACE] 21:23:20.035 shell_unix.go:DirIsWritable(/home/programie) - 6.631µs
[TRACE] 21:23:20.035 shell.go:GOOS() - 40ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 41ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 40ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 40ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 40ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 40ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 40ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 39ns
[TRACE] 21:23:20.035 shell.go:GOOS() - 46ns
[DEBUG] 21:23:20.035 shell.go:User:494 → programie
[TRACE] 21:23:20.035 shell.go:User() - 4.199µs
[DEBUG] 21:23:20.035 shell.go:Host:511 → minty
[TRACE] 21:23:20.035 shell.go:Host() - 5.985µs
[TRACE] 21:23:20.035 shell.go:GOOS() - 45ns
[DEBUG] 21:23:20.035 shell_unix.go:Platform:87 → ubuntu
[DEBUG] 21:23:20.035 shell.go:Getenv:326 → 3
[TRACE] 21:23:20.035 shell.go:Getenv(SHLVL) - 3.736µs
[TRACE] 21:23:20.035 shell.go:TemplateCache() - 307.934µs
[TRACE] 21:23:20.035 shell.go:TemplateCache() - 248.858µs
[TRACE] 21:23:20.035 shell.go:TemplateCache() - 87.857µs
[DEBUG] 21:23:20.036 shell.go:RunCommand:531 → NO DATA
[TRACE] 21:23:20.036 shell.go:RunCommand(who am i) - 1.636542ms
[TRACE] 21:23:20.036 shell.go:TemplateCache() - 194ns
[DEBUG] 21:23:20.036 text.go:Render:71 → Rendering template: ╭─
[TRACE] 21:23:20.036 shell.go:Shell() - 150ns
[DEBUG] 21:23:20.036 text.go:Render:71 → Rendering template:   {{ .Path }}
[DEBUG] 21:23:20.036 text.go:Render:71 → Rendering template:  {{ if .WSL }}WSL at {{ end }}{{.Icon}}
[DEBUG] 21:23:20.036 text.go:Render:71 → Rendering template: {{ if .Root }} {{ end }}{{ if .SSHSession }} {{ end }}{{ .UserName }}@{{ .HostName }}
[TRACE] 21:23:20.038 shell.go:TemplateCache() - 430ns
[TRACE] 21:23:20.038 shell.go:Shell() - 215ns
[TRACE] 21:23:20.038 shell.go:TemplateCache() - 311ns
[TRACE] 21:23:20.038 shell.go:Shell() - 122ns
[TRACE] 21:23:20.038 shell.go:Shell() - 113ns
[DEBUG] 21:23:20.038 shell.go:Getenv:326 → tmux
[TRACE] 21:23:20.038 shell.go:Getenv(TERM_PROGRAM) - 9.549µs
[DEBUG] 21:23:20.038 text.go:Render:71 → Rendering template: plain
[DEBUG] 21:23:20.038 text.go:Render:71 → Rendering template: diamond
[DEBUG] 21:23:20.038 text.go:Render:71 → Rendering template: {{ if .Root }}p:red{{ else }}p:black{{ end }}
[TRACE] 21:23:20.038 shell.go:TemplateCache() - 196ns
[DEBUG] 21:23:20.038 text.go:Render:71 → Rendering template: {{ if .Root }}p:white{{ else }}p:yellow{{ end }}
[TRACE] 21:23:20.038 shell.go:TemplateCache() - 137ns
[DEBUG] 21:23:20.038 text.go:Render:71 → Rendering template: powerline
[DEBUG] 21:23:20.038 text.go:Render:71 → Rendering template: {{ if .Writable }}p:blue{{ else }}p:red{{ end }}
[TRACE] 21:23:20.039 shell.go:TemplateCache() - 114ns
[DEBUG] 21:23:20.039 text.go:Render:71 → Rendering template: {{ if .Writable }}p:black{{ else }}p:white{{ end }}
[TRACE] 21:23:20.039 shell.go:TemplateCache() - 118ns
[DEBUG] 21:23:20.039 text.go:Render:71 → Rendering template: powerline
[DEBUG] 21:23:20.039 text.go:Render:71 → Rendering template: powerline
[TRACE] 21:23:20.039 shell.go:Shell() - 101ns
[TRACE] 21:23:20.039 shell.go:Shell() - 35ns
[TRACE] 21:23:20.039 shell.go:Shell() - 37ns
[TRACE] 21:23:20.039 shell.go:Shell() - 34ns
[TRACE] 21:23:20.039 shell.go:Flags() - 73ns
[TRACE] 21:23:20.039 shell.go:Flags() - 185ns
[TRACE] 21:23:20.039 shell.go:Flags() - 177ns
[TRACE] 21:23:20.039 shell.go:GOOS() - 112ns
[DEBUG] 21:23:20.039 segment.go:SetEnabled:536 → Segment: Time
[DEBUG] 21:23:20.039 segment.go:SetEnabled:536 → Segment: Executiontime
[DEBUG] 21:23:20.039 properties.go:GetString:28 → 15:04:05
[TRACE] 21:23:20.039 shell.go:Flags() - 215ns
[DEBUG] 21:23:20.039 properties.go:GetBool:22 → always_enabled: false
[TRACE] 21:23:20.039 shell.go:ExecutionTime() - 169ns
[DEBUG] 21:23:20.039 properties.go:GetString:28 → environment
[DEBUG] 21:23:20.039 properties.go:GetFloat64:34 → threshold: 2000.000000
[TRACE] 21:23:20.039 shell.go:Pwd() - 263ns
[TRACE] 21:23:20.039 shell.go:GOOS() - 91ns
[DEBUG] 21:23:20.039 segment.go:SetEnabled:536 → Segment: Python
[TRACE] 21:23:20.039 shell.go:TemplateCache() - 116ns
[DEBUG] 21:23:20.039 properties.go:GetStringArray:52 → extensions: [*.py *.ipynb pyproject.toml venv.bak]
[DEBUG] 21:23:20.039 properties.go:GetStringArray:52 → folders: [.venv venv virtualenv venv-win pyenv-win]
[DEBUG] 21:23:20.039 properties.go:GetBool:22 → home_enabled: false
[DEBUG] 21:23:20.039 properties.go:GetString:28 → {{ .Code }}
[TRACE] 21:23:20.039 shell.go:Pwd() - 293ns
[TRACE] 21:23:20.039 shell.go:GOOS() - 88ns
[DEBUG] 21:23:20.039 segment.go:SetEnabled:536 → Segment: Status
[TRACE] 21:23:20.039 shell.go:StatusCodes() - 145ns
[DEBUG] 21:23:20.039 text.go:Render:71 → Rendering template: {{ .Code }}
[TRACE] 21:23:20.040 shell.go:TemplateCache() - 282ns
[DEBUG] 21:23:20.040 properties.go:GetBool:22 → always_enabled: false
[DEBUG] 21:23:20.040 text.go:Render:71 → Rendering template:  {{ .CurrentDate | date .Format }}
[TRACE] 21:23:20.040 shell.go:TemplateCache() - 141ns
[TRACE] 21:23:20.040 shell.go:Shell() - 118ns
[DEBUG] 21:23:20.040 text.go:Render:71 → Rendering template: powerline
[DEBUG] 21:23:20.040 text.go:Render:71 → Rendering template: powerline
[DEBUG] 21:23:20.040 text.go:Render:71 → Rendering template: powerline
[DEBUG] 21:23:20.040 text.go:Render:71 → Rendering template: diamond
[DEBUG] 21:23:20.041 shell_unix.go:TerminalWidth:80 → terminal width: 213
[TRACE] 21:23:20.041 shell_unix.go:TerminalWidth() - 1.214965ms
[TRACE] 21:23:20.041 shell.go:Shell() - 73ns
[TRACE] 21:23:20.041 shell.go:Shell() - 55ns
[TRACE] 21:23:20.041 shell.go:Shell() - 31ns
[TRACE] 21:23:20.041 shell.go:Shell() - 30ns
[TRACE] 21:23:20.041 shell.go:Flags() - 84ns
[TRACE] 21:23:20.041 shell.go:Pwd() - 110ns
[TRACE] 21:23:20.041 shell.go:GOOS() - 69ns
[DEBUG] 21:23:20.041 segment.go:SetEnabled:536 → Segment: Text
[TRACE] 21:23:20.041 shell.go:TemplateCache() - 76ns
[DEBUG] 21:23:20.041 text.go:Render:71 → Rendering template: ╰─#
[TRACE] 21:23:20.041 shell.go:Shell() - 55ns
[DEBUG] 21:23:20.041 shell.go:Getenv:326 → tmux
[TRACE] 21:23:20.041 shell.go:Getenv(TERM_PROGRAM) - 3.635µs
[DEBUG] 21:23:20.041 text.go:Render:71 → Rendering template: plain
[TRACE] 21:23:20.041 shell.go:Shell() - 56ns
[TRACE] 21:23:20.041 shell.go:Shell() - 35ns
[TRACE] 21:23:20.041 shell.go:Shell() - 34ns
[TRACE] 21:23:20.041 shell.go:Shell() - 33ns
[TRACE] 21:23:20.041 shell.go:Flags() - 52ns
[DEBUG] 21:23:20.041 shell.go:Getenv:326 → NO DATA
[TRACE] 21:23:20.041 shell.go:Getenv(OMP_CACHE_DIR) - 3.429µs
[DEBUG] 21:23:20.041 shell.go:Getenv:326 → /home/programie/snap/alacritty/common/.cache
[TRACE] 21:23:20.041 shell.go:Getenv(XDG_CACHE_HOME) - 3.136µs
[TRACE] 21:23:20.041 shell_unix.go:CachePath() - 25.12µs
[TRACE] 21:23:20.041 shell.go:Flags() - 55ns
JanDeDobbeleer commented 2 months ago

@Programie my hunch is that the _set_posh_cursor_position function is responsible for this one. Does it occur when you set disable_cursor_positioning to false in the config (root of the configuration).

Programie commented 2 months ago

I just tried your suggested configuration option.

Setting it to false does not change anything, but changing it to true fixes the issue for me. But what's the downside of enabling that option?

JanDeDobbeleer commented 2 months ago

@Programie you're right, I made a mistake there. The downside is that now oh-my-posh can't know if we're at the top of the terminal to not print the initial newline you have in the first block in your config. Nothing else. The echo to fetch the position is what eats your characters. There's no fix for this other than it being one or the other.