JanDeDobbeleer / oh-my-posh

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

NuShell: An empty line is printed when executing a command #4237

Closed matcls closed 1 year ago

matcls commented 1 year ago

Code of Conduct

What happened?

In NuShell (linux and windows) an empty line is printed when running a command Testing it seems to happen only with themes with rprompt

oh-my-posh_18 7 0_NuShell_extra_line

This happens since version v18.2.3

oh-my-posh_NuShell_before_v18 2 3

Does not occur in powershell or fish.

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "final_space": true,
  "console_title_template": "{{ if .Segments.Session.SSHSession }}SSH [{{ if or .HostName }}{{.HostName}}]:{{end}} {{ if or .Root }} & {{end}}{{end}}{{ if .Root }}⚡{{ end }}{{ if .WSL }}WSL | {{ end }}{{.Folder }}",
  "accent_color": "#E06C75",
  "blocks": [
    {
      "type": "prompt",
      "segments": [
        {
          "type": "root",
          "style": "plain",
          "foreground": "#E06C75",
          "template": "<p:red>\uf0e7</>"
        },
        {
          "type": "session",
          "style": "plain",
          "template": "{{ if .SSHSession }}<#FF9248>\ueba9 {{ .UserName }}@{{abbrev 16 .HostName }} </>\n{{ end }}{{ if false }}{{ end }}"
        }
      ]
    },
    {
      "type": "rprompt",
      "segments": [
        {
          "type": "status",
          "style": "plain",
          "foreground": "#55B9C4",
          "foreground_templates": [
            "{{ if gt .Code 0 }}#cc2222{{ end }}"
          ],
          "template": "{{ if gt .Code 0 }}<i>{{ $code := toString .Code }}{{ if eq $code (reason .Code) }}{{ .Code }} {{ else }}{{ reason .Code }}</i>:{{ .Code }} {{ end }}{{ end }}",
          "properties": {
            "status_template": "{{ if gt .Code 0 }}\uf071{{ else }}\uf00c{{ end }}",
            "always_enabled": true
          }
        },
        {
          "type": "sysinfo",
          "style": "plain",
          "foreground": "#55B9C4",
          "foreground_templates": [
            "{{ if lt .PhysicalPercentUsed 54.00 }}#55B9C4{{ else if lt .PhysicalPercentUsed 58.00 }}#bbcc88{{ else if (lt .PhysicalPercentUsed 78.00) }}#F59E6A{{ else if (gt .PhysicalPercentUsed 77.00) }}#DD6677{{ end }}"
          ],
          "template": "{{ if (lt .PhysicalPercentUsed 44.00) }}{{ else }}<#55B9C4>{{ if .Segments.Git.RepoName }} {{ end }}</>\udb80\udf5b {{ round .PhysicalPercentUsed .Precision }}% {{ end }}",
          "properties": {
            "precision": 2
          }
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "overflow": "break",
      "segments": [
        {
          "type": "path",
          "style": "plain",
          "min_width": 0,
          "foreground": "#55B9C4",
          "templates": [
            "{{if contains \"docs\" .Path}}\uf114 {{else}}{{if contains \"Dropbox\" .Path}}\uf16b {{end}}{{end}}{{ .Path }}{{if .Writable }}{{ else }} <p:brightRed>\ue0a2</>{{ end }}{{ if .Segments.Executiontime.Ms }} {{end}}",
            "{{ if .Segments.Executiontime.Ms }}{{ if .RootDir }}\ueb46 {{ $root := trimAll \":\" .Path }}{{ trunc 1 $root }} {{ else }}{{ path .Path .Location }} {{end}}{{else}}{{ if .RootDir }}\ueb46 {{ $root := trimAll \":\" .Path }}{{ trunc 1 $root }}{{ else }}{{ path .Path .Location }}{{end}}{{end}}"
          ],      
          "templates_logic": "first_match",
          "properties": {
            "folder_separator_icon": " \uf054 ",
            "hide_root_location": true,
            "home_icon": "\uf46d ",
            "mapped_locations": {
              "T:/source": "\uf1d2 ",
              "~/.config": "\ue5fc ",
              "~/Dropbox": "\uf16b "
            },
            "max_depth": 1,
            "hide_root_location": true,
            "mixed_threshold": 5,
            "max_length": 4,
            "style": "agnoster_short"
          }
        },
        {
          "type": "executiontime",
          "style": "plain",
          "foreground": "#55B9C4",
          "template": "\ue641 {{ .FormattedMs }}",
          "properties": {
            "always_enabled": false,
            "style": "austin",
            "threshold": 100
          }
        },
        {
          "type": "text",
          "style": "plain",
          "foreground_templates": [
           "{{ if .Segments.Session.SSHSession }}#FF9248{{ end }}", 
           "{{ if gt .Code 0 }}p:red{{ end }}"
          ],
          "foreground": "#63F08C",
          "template": "\uf432"
        }
      ]
    }
  ],
  "valid_line": {
    "foreground": "#ffffff",
    "background": "transparent",
    "template": " <transparent,transparent>\uf42e </><#55B9C4,transparent>\uf42e</> "
  },
  "error_line": {
    "foreground": "#E06C75",
    "background": "transparent",
    "template": "<transparent,transparent>\ue009 </><#E06C75,transparent>\ue009</> "
  },
  "palette": {
    "background": "#403E41",
    "black": "#403E41",
    "blue": "#FC9867",
    "brightBlack": "#727072",
    "brightBlue": "#FC9867",
    "brightCyan": "#78DCE8",
    "brightGreen": "#A9DC76",
    "brightPurple": "#AB9DF2",
    "brightRed": "#FF6188",
    "brightWhite": "#FCFCFA",
    "brightYellow": "#FFD866",
    "c-shell-state-root-active": "#9FFFE0",
    "c-shell-state-root-ssh-active": "#FFB2FF",
    "c-shell-state-ssh-active": "#BAFFFF",
    "cursorColor": "#FCFCFA",
    "cyan": "#78DCE8",
    "foreground": "#FCFCFA",
    "green": "#A9DC76",
    "name": "Monokai Plus",
    "purple": "#9e9ed1",
    "red": "#FF6188",
    "selectionBackground": "#FCFCFA",
    "white": "#FCFCFA",
    "yellow": "#FFD866"
  }
}

What OS are you seeing the problem on?

Windows, Linux

Which shell are you using?

nu

Log output

Version: 18.7.0

Shell: nu (0.84.0)

Prompt:

                                                                                                                                                             󰍛 54.97% 

Segments:

ConsoleTitle(true)                         -   3 ms
Root(false)                                -   0 ms
Session(false)                             -   0 ms
Status(false)                              -   1 ms
Sysinfo(true)                              -   1 ms
Path(true)                                 -   1 ms
Executiontime(false)                       -   0 ms
Text(true)                                 -   0 ms

Run duration: 48.627537ms

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

Config path: /home/mat/.poshthemes/test.json

Logs:

[DEBUG] 23:36:10.071 shell.go:Getenv:392 → NO DATA
[TRACE] 23:36:10.072 shell.go:Getenv(TERM_PROGRAM) - 73.683µs
[DEBUG] 23:36:10.072 shell.go:Getenv:392 → NO DATA
[TRACE] 23:36:10.072 shell.go:Getenv(XDG_CACHE_HOME) - 20.394µs
[TRACE] 23:36:10.072 shell_unix.go:CachePath() - 80.947µs
[DEBUG] 23:36:10.085 shell.go:Getenv:392 → /home/mat/.poshthemes/test.json
[TRACE] 23:36:10.085 shell.go:Getenv(POSH_THEME) - 56.781µs
[DEBUG] 23:36:10.085 shell_unix.go:Platform:77 → void
[TRACE] 23:36:10.085 shell.go:resolveConfigPath() - 129.487µs
[TRACE] 23:36:10.085 shell.go:Init() - 13.956399ms
[TRACE] 23:36:10.085 shell.go:Flags() - 2.235µs
[TRACE] 23:36:10.088 config.go:loadConfig() - 2.621172ms
[TRACE] 23:36:10.088 shell.go:Flags() - 2.445µs
[DEBUG] 23:36:10.088 shell.go:Getenv:392 → NO DATA
[TRACE] 23:36:10.088 shell.go:Getenv(OMP_CACHE_DISABLED) - 49.798µs
[TRACE] 23:36:10.088 shell.go:Flags() - 2.305µs
[TRACE] 23:36:10.088 shell.go:Flags() - 1.956µs
[DEBUG] 23:36:10.088 shell.go:Shell:632 → no shell name provided in flags, trying to detect it
[DEBUG] 23:36:10.096 shell.go:Shell:640 → process name: nu
[TRACE] 23:36:10.096 shell.go:Shell() - 8.005856ms
[DEBUG] 23:36:10.096 shell.go:Getenv:392 → 0.84.0
[TRACE] 23:36:10.096 shell.go:Getenv(POSH_SHELL_VERSION) - 22.768µs
[DEBUG] 23:36:10.096 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 23:36:10.096 text.go:Render:70 → Rendering template: {{ if .Segments.Session.SSHSession }}SSH [{{ if or .HostName }}{{.HostName}}]:{{end}} {{ if or .Root }} & {{end}}{{end}}{{ if .Root }}⚡{{ end }}{{ if .WSL }}WSL | {{ end }}{{.Folder }}
[TRACE] 23:36:10.098 shell_unix.go:Root() - 4.819µs
[TRACE] 23:36:10.098 shell.go:Shell() - 2.585µs
[TRACE] 23:36:10.098 shell.go:StatusCodes() - 2.305µs
[DEBUG] 23:36:10.098 shell_unix.go:IsWsl:35 → false
[TRACE] 23:36:10.098 shell_unix.go:IsWsl() - 46.724µs
[DEBUG] 23:36:10.098 shell.go:TemplateCache:813 ↓
    environment: [ATUIN_HISTORY_ID=018a6dd9f88f72a8b35e54fe106e0e87 ATUIN_SESSION=018a6dd67ff57479b68b19be04cd36d6 CMD_DURATION_MS=3 COLORTERM=truecolor DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-zJr8hTCfXn,guid=c7394cfb04fee0e62fbf566764f896ad DESKTOP_SESSION=Xfce Session DIRS_POSITION=0 DISPLAY=:0.0 GTK3_MODULES=xapp-gtk3-module HOME=/home/mat JAVA_HOME=/usr/lib/jvm/openjdk17 LANG=en_US.UTF-8 LAST_EXIT_CODE=0 LC_COLLATE=C LOGNAME=mat LOG_FORMAT=%ANSI_START%%DATE%|%LEVEL%|%MSG%%ANSI_STOP% MAIL=/var/mail/mat MOTD_SHOWN=pam MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins NUSHELL_LAST_SHELL=0 NVM_CD_FLAGS= NVM_DIR=/home/mat/.nvm NVM_RC_VERSION= OLDPWD=/home/mat/.local/src/keydgit PATH=/home/mat/.config/carapace/bin:/usr/local/bin:/home/mat/.local/src/diff-so-fancy:/home/mat/.cargo/bin:/home/mat/.local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/sbin:/bin POSH_PID=7b68d458-3623-48a9-97d3-3116b3e95b2b POSH_SHELL_VERSION=0.84.0 POSH_THEME=/home/mat/.poshthemes/test.json POWERLINE_COMMAND=oh-my-posh PROMPT_COMMAND_RIGHT= PROMPT_INDICATOR= PROMPT_MULTILINE_INDICATOR=  PWD=/home/mat SESSION_MANAGER=local/TS:@/tmp/.ICE-unix/1244,unix/TS:/tmp/.ICE-unix/1244 SHELL=/bin/fish SHLVL=1 SSH_AGENT_PID=1385 SSH_AUTH_SOCK=/tmp/ssh-XXXXXXORUo4d/agent.1384 TERM=xterm-256color USER=mat VTE_VERSION=7200 WINDOWID=20971523 XAUTHORITY=/home/mat/.Xauthority XDG_CONFIG_DIRS=/etc/xdg XDG_CURRENT_DESKTOP=XFCE XDG_DATA_DIRS=/usr/local/share:/usr/share XDG_MENU_PREFIX=xfce- XDG_RUNTIME_DIR=/run/user/1000 XDG_SEAT=seat0 XDG_SESSION_CLASS=user XDG_SESSION_ID=1 XDG_SESSION_TYPE=x11 XDG_VTNR=7 omp_last_status_generation=7 omp_lastcommand=sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
    sudo chmod +x /usr/local/bin/oh-my-posh]
[TRACE] 23:36:10.099 shell.go:GOOS() - 2.375µs
[DEBUG] 23:36:10.099 shell.go:Pwd:422 → /home/mat
[TRACE] 23:36:10.099 shell.go:Pwd() - 76.547µs
[TRACE] 23:36:10.099 shell.go:GOOS() - 2.165µs
[TRACE] 23:36:10.099 shell.go:GOOS() - 2.165µs
[TRACE] 23:36:10.099 shell.go:GOOS() - 2.165µs
[TRACE] 23:36:10.099 shell.go:GOOS() - 1.956µs
[TRACE] 23:36:10.099 shell.go:GOOS() - 2.165µs
[DEBUG] 23:36:10.099 shell.go:User:543 → mat
[TRACE] 23:36:10.099 shell.go:User() - 22µs
[DEBUG] 23:36:10.099 shell.go:Host:555 → TS
[TRACE] 23:36:10.099 shell.go:Host() - 326.722µs
[TRACE] 23:36:10.099 shell.go:GOOS() - 2.235µs
[DEBUG] 23:36:10.099 shell_unix.go:Platform:77 → void
[DEBUG] 23:36:10.099 shell.go:Getenv:392 → 1
[TRACE] 23:36:10.099 shell.go:Getenv(SHLVL) - 21.581µs
[TRACE] 23:36:10.099 shell.go:TemplateCache() - 1.04386ms
[DEBUG] 23:36:10.099 shell.go:Getenv:392 → NO DATA
[TRACE] 23:36:10.099 shell.go:Getenv(POSH_CURSOR_LINE) - 22.908µs
[DEBUG] 23:36:10.099 shell.go:Getenv:392 → NO DATA
[TRACE] 23:36:10.099 shell.go:Getenv(POSH_CURSOR_COLUMN) - 17.74µs
[TRACE] 23:36:10.099 shell.go:Flags() - 1.956µs
[TRACE] 23:36:10.100 shell.go:Flags() - 2.026µs
[TRACE] 23:36:10.100 shell.go:Shell() - 2.584µs
[TRACE] 23:36:10.100 shell.go:Flags() - 3.073µs
[TRACE] 23:36:10.100 shell.go:Pwd() - 2.585µs
[TRACE] 23:36:10.100 shell.go:GOOS() - 2.374µs
[DEBUG] 23:36:10.100 segment.go:SetEnabled:497 → Segment: Session
[DEBUG] 23:36:10.100 shell.go:Getenv:392 → NO DATA
[TRACE] 23:36:10.100 shell.go:Getenv(SSH_CONNECTION) - 43.581µs
[DEBUG] 23:36:10.100 shell.go:Getenv:392 → NO DATA
[TRACE] 23:36:10.100 shell.go:Getenv(SSH_CLIENT) - 17.879µs
[TRACE] 23:36:10.100 shell.go:TemplateCache() - 2.654µs
[TRACE] 23:36:10.100 shell.go:Flags() - 22.908µs
[TRACE] 23:36:10.100 shell.go:Pwd() - 2.514µs
[TRACE] 23:36:10.100 shell.go:GOOS() - 2.304µs
[DEBUG] 23:36:10.100 segment.go:SetEnabled:497 → Segment: Root
[TRACE] 23:36:10.100 shell_unix.go:Root() - 4.12µs
[DEBUG] 23:36:10.100 text.go:Render:70 ↓
    Rendering template: {{ if .SSHSession }}<#FF9248> {{ .UserName }}@{{abbrev 16 .HostName }} </>
    {{ end }}{{ if false }}{{ end }}
[TRACE] 23:36:10.102 shell.go:TemplateCache() - 3.282µs
[TRACE] 23:36:10.102 shell.go:TemplateCache() - 2.654µs
[TRACE] 23:36:10.102 shell.go:Shell() - 2.724µs
[TRACE] 23:36:10.103 shell.go:Shell() - 2.654µs
[TRACE] 23:36:10.103 shell.go:Shell() - 2.235µs
[TRACE] 23:36:10.103 shell.go:Shell() - 2.235µs
[TRACE] 23:36:10.104 shell.go:Flags() - 2.514µs
[DEBUG] 23:36:10.104 properties.go:GetInt:40 → precision: 2
[TRACE] 23:36:10.105 shell.go:Flags() - 2.444µs
[DEBUG] 23:36:10.105 properties.go:GetString:28 → {{ if gt .Code 0 }}{{ else }}{{ end }}
[TRACE] 23:36:10.105 shell.go:Pwd() - 2.863µs
[TRACE] 23:36:10.105 shell.go:GOOS() - 2.444µs
[DEBUG] 23:36:10.105 segment.go:SetEnabled:497 → Segment: Status
[TRACE] 23:36:10.105 shell.go:StatusCodes() - 2.375µs
[DEBUG] 23:36:10.105 text.go:Render:70 → Rendering template: {{ if gt .Code 0 }}{{ else }}{{ end }}
[TRACE] 23:36:10.105 shell.go:TemplateCache() - 3.213µs
[DEBUG] 23:36:10.106 properties.go:GetBool:22 → always_enabled: true
[TRACE] 23:36:10.106 shell.go:TemplateCache() - 2.654µs
[TRACE] 23:36:10.106 shell.go:Pwd() - 2.724µs
[TRACE] 23:36:10.106 shell.go:GOOS() - 2.304µs
[DEBUG] 23:36:10.106 segment.go:SetEnabled:497 → Segment: Sysinfo
[TRACE] 23:36:10.106 shell.go:TemplateCache() - 2.514µs
[DEBUG] 23:36:10.106 text.go:Render:70 → Rendering template: {{ if (lt .PhysicalPercentUsed 44.00) }}{{ else }}<#55B9C4>{{ if .Segments.Git.RepoName }} {{ end }}</>󰍛 {{ round .PhysicalPercentUsed .Precision }}% {{ end }}
[TRACE] 23:36:10.107 shell.go:TemplateCache() - 3.352µs
[TRACE] 23:36:10.107 shell.go:Shell() - 3.142µs
[DEBUG] 23:36:10.107 text.go:Render:70 → Rendering template: {{ if gt .Code 0 }}<i>{{ $code := toString .Code }}{{ if eq $code (reason .Code) }}{{ .Code }} {{ else }}{{ reason .Code }}</i>:{{ .Code }} {{ end }}{{ end }}
[TRACE] 23:36:10.108 shell.go:TemplateCache() - 4.33µs
[TRACE] 23:36:10.108 shell.go:TemplateCache() - 2.584µs
[TRACE] 23:36:10.108 shell.go:Shell() - 2.585µs
[DEBUG] 23:36:10.108 text.go:Render:70 → Rendering template: plain
[DEBUG] 23:36:10.108 text.go:Render:70 → Rendering template: {{ if lt .PhysicalPercentUsed 54.00 }}#55B9C4{{ else if lt .PhysicalPercentUsed 58.00 }}#bbcc88{{ else if (lt .PhysicalPercentUsed 78.00) }}#F59E6A{{ else if (gt .PhysicalPercentUsed 77.00) }}#DD6677{{ end }}
[TRACE] 23:36:10.109 shell.go:TemplateCache() - 3.352µs
[DEBUG] 23:36:10.109 text.go:Render:70 → Rendering template: plain
[TRACE] 23:36:10.109 shell.go:Shell() - 2.654µs
[TRACE] 23:36:10.109 shell.go:Shell() - 2.305µs
[TRACE] 23:36:10.109 shell.go:Shell() - 2.165µs
[TRACE] 23:36:10.109 shell.go:Flags() - 2.445µs
[TRACE] 23:36:10.109 shell.go:Flags() - 2.654µs
[TRACE] 23:36:10.109 shell.go:Pwd() - 2.794µs
[TRACE] 23:36:10.109 shell.go:GOOS() - 2.305µs
[TRACE] 23:36:10.109 shell.go:Pwd() - 2.025µs
[DEBUG] 23:36:10.109 segment.go:SetEnabled:497 → Segment: Text
[TRACE] 23:36:10.109 shell.go:GOOS() - 2.305µs
[TRACE] 23:36:10.109 shell.go:TemplateCache() - 2.724µs
[DEBUG] 23:36:10.109 segment.go:SetEnabled:497 → Segment: Path
[TRACE] 23:36:10.109 shell.go:Pwd() - 1.607µs
[TRACE] 23:36:10.110 shell.go:Flags() - 2.235µs
[TRACE] 23:36:10.110 shell.go:Shell() - 2.305µs
[TRACE] 23:36:10.110 shell.go:Shell() - 2.375µs
[TRACE] 23:36:10.110 shell.go:Pwd() - 2.445µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[DEBUG] 23:36:10.110 segment.go:SetEnabled:497 → Segment: Executiontime
[DEBUG] 23:36:10.110 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 23:36:10.110 properties.go:GetBool:22 → always_enabled: false
[DEBUG] 23:36:10.110 properties.go:GetString:28 → 
[TRACE] 23:36:10.110 shell.go:ExecutionTime() - 2.305µs
[DEBUG] 23:36:10.110 properties.go:GetString:28 → 
[DEBUG] 23:36:10.110 properties.go:GetFloat64:34 → threshold: 100.000000
[TRACE] 23:36:10.110 shell.go:GOOS() - 1.187µs
[DEBUG] 23:36:10.110 properties.go:GetString:28 →  
[DEBUG] 23:36:10.110 properties.go:GetKeyValueMap:46 → mapped_locations: map[T:/source:  ~/.config:  ~/Dropbox: ]
[DEBUG] 23:36:10.110 text.go:Render:70 → Rendering template: T:/source
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.305µs
[DEBUG] 23:36:10.110 text.go:Render:70 → Rendering template: ~/.config
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[DEBUG] 23:36:10.110 text.go:Render:70 → Rendering template: ~/Dropbox
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[TRACE] 23:36:10.110 shell.go:PathSeparator() - 2.305µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.514µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.375µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.375µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[TRACE] 23:36:10.110 shell.go:PathSeparator() - 2.305µs
[TRACE] 23:36:10.110 shell.go:PathSeparator() - 2.235µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[TRACE] 23:36:10.110 shell.go:PathSeparator() - 2.235µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.304µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.305µs
[TRACE] 23:36:10.110 shell.go:PathSeparator() - 2.235µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.166µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.304µs
[TRACE] 23:36:10.110 shell.go:PathSeparator() - 2.305µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[TRACE] 23:36:10.110 shell.go:PathSeparator() - 2.235µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[TRACE] 23:36:10.110 shell.go:GOOS() - 2.235µs
[TRACE] 23:36:10.111 shell.go:PathSeparator() - 2.235µs
[TRACE] 23:36:10.111 shell.go:GOOS() - 2.305µs
[TRACE] 23:36:10.111 shell.go:GOOS() - 2.304µs
[TRACE] 23:36:10.111 shell.go:PathSeparator() - 2.235µs
[TRACE] 23:36:10.111 shell.go:Pwd() - 2.445µs
[DEBUG] 23:36:10.111 shell_unix.go:IsWsl:35 → false
[TRACE] 23:36:10.111 shell_unix.go:IsWsl() - 23.746µs
[TRACE] 23:36:10.111 shell.go:StackCount() - 2.305µs
[TRACE] 23:36:10.111 shell_unix.go:DirIsWritable(/home/mat) - 29.334µs
[TRACE] 23:36:10.111 shell.go:TemplateCache() - 2.654µs
[DEBUG] 23:36:10.111 text.go:Render:70 → Rendering template: 
[DEBUG] 23:36:10.111 text.go:Render:70 → Rendering template: {{if contains "docs" .Path}} {{else}}{{if contains "Dropbox" .Path}} {{end}}{{end}}{{ .Path }}{{if .Writable }}{{ else }} <p:brightRed></>{{ end }}{{ if .Segments.Executiontime.Ms }} {{end}}
[TRACE] 23:36:10.111 shell.go:Shell() - 2.374µs
[TRACE] 23:36:10.112 shell.go:TemplateCache() - 2.724µs
[TRACE] 23:36:10.112 shell.go:Shell() - 2.165µs
[DEBUG] 23:36:10.112 text.go:Render:70 → Rendering template: plain
[DEBUG] 23:36:10.112 text.go:Render:70 → Rendering template: plain
[DEBUG] 23:36:10.112 text.go:Render:70 → Rendering template: {{ if .Segments.Session.SSHSession }}#FF9248{{ end }}
[TRACE] 23:36:10.112 shell.go:TemplateCache() - 2.793µs
[DEBUG] 23:36:10.113 text.go:Render:70 → Rendering template: {{ if gt .Code 0 }}p:red{{ end }}
[TRACE] 23:36:10.116 shell.go:TemplateCache() - 4.54µs
[DEBUG] 23:36:10.116 text.go:Render:70 → Rendering template: plain
[TRACE] 23:36:10.116 shell.go:Shell() - 2.584µs
[TRACE] 23:36:10.116 shell.go:Shell() - 1.886µs
[TRACE] 23:36:10.116 shell.go:Flags() - 2.235µs
[TRACE] 23:36:10.116 shell.go:Shell() - 2.305µs
[TRACE] 23:36:10.116 shell.go:Shell() - 2.165µs
[DEBUG] 23:36:10.120 shell_unix.go:TerminalWidth:70 → terminal width: 168
[TRACE] 23:36:10.120 shell_unix.go:TerminalWidth() - 3.52437ms
[DEBUG] 23:36:10.120 shell.go:Getenv:392 → NO DATA
[TRACE] 23:36:10.120 shell.go:Getenv(XDG_CACHE_HOME) - 23.746µs
[TRACE] 23:36:10.120 shell_unix.go:CachePath() - 79.41µs
[TRACE] 23:36:10.120 shell.go:Flags() - 2.305µs
ZerdoX-x commented 1 year ago

Can't confirm this on nushell 0.84.0 (same as yours). Tried OMP 18.5.1 and 18.9.0 (latest atm). Running Linux 6.4.0 and default M365Princess theme.

Screenshot ![image](https://github.com/JanDeDobbeleer/oh-my-posh/assets/49815452/17b44c73-092b-4e24-8488-cdfaf1ecc360)
matcls commented 1 year ago

Thanks @ZerdoX-x are you using a theme with rprompt? It seems to happen only with themes with rprompt

ZerdoX-x commented 1 year ago

I guess no, M365Princess doesn't use right side of the prompt.

I tried to use your theme and for some reason I can't see right side of the prompt. Do I need to do something special to get ram usage as on your screenshot? I am using the same file which oh-my-posh init nu gave me and completely default nushell (no settings in config file)

Also, if needed, you can check my configuration: https://git.sr.ht/~zerdox/dotfiles/tree/master/item/home/zerdox/.config/oh-my-posh https://git.sr.ht/~zerdox/dotfiles/tree/master/item/home/zerdox/.config/nushell

UPD: I remember when I was using generated nu config, I had prompt with right part showing time.

JanDeDobbeleer commented 1 year ago

@matcls confirmed to be an issue, although I can't explain this. Even when moving the rprompt a bit to the left it keeps adding a newline. I have the feeling this is a nushell thing where going from using ANSI characters to position the right prompt (what we did before) to using spaces (correctly calculated) results in this weird behaviour.

@fdncred or @jntrnr any idea as to why this happens? We don't use nushell's built-in PROMPT_COMMAND_RIGHT due to it printing the right prompt on the first line which breaks multi-line prompts (if that's changed in the meantime I missed it).

fdncred commented 1 year ago

I haven't looked at the details of this issue yet but you mention the right prompt line. Just wondering if you knew there was a config option for which line the right prompt is printed on?

I'm in the car, on my phone, or I'd look it up and tell you what it is.

fdncred commented 1 year ago

This is the config.nu setting we added a while back to control where the right prompt is rendered.

  render_right_prompt_on_last_line: true # true or false to enable or disable right prompt to be rendered on last line of the prompt.

I'm wondering if this was used if it would make a difference in this issue?

fdncred commented 1 year ago

I looked at it for a while and I can't see how to reproduce the problem in nushell without using this config in omp. Not saying it's not a nushell problem, but I'm not seeing a good way to repro it. It could be a reedline issue too, the nushell line editor.

JanDeDobbeleer commented 1 year ago

I'm wondering if this was used if it would make a difference in this issue?

@fdncred confirmed to be working. I'm going to make that change and add this information to the docs. Amazing!

github-actions[bot] commented 6 months 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.