Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path location hyperlinks broken in Bash on Windows #5125

Closed
1 task done
stanio opened this issue Jun 19, 2024 · 1 comment
Closed
1 task done

Path location hyperlinks broken in Bash on Windows #5125

stanio opened this issue Jun 19, 2024 · 1 comment
Assignees
Labels
🐛 bug Something isn't working

Comments

@stanio
Copy link

stanio commented Jun 19, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

Path segment with location hyperlink stopped working in (Git) Bash on Windows, while still working in Cmd (w/ Clink). I've narrowed the regression window to: v21.10.1...v21.10.2

Happens with v21.13.1, also. As far as I see the link with Cmd is file:C:\Users\stanio, while in Bash it ends up file:C:\Usersbashtanio:

ver. cmd bash
v21.10.2 cmd-omp-v21.10.2 bash-omp-v21.10.2
v21.10.1 cmd-omp-v21.10.1 bash-omp-v21.10.1

Theme

stanio.omp.jsonc
{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "right",
      "segments": [
        {
          "foreground": "darkGray",
          "style": "plain",
          "template": "{{ .FormattedMs }} | ",
          "type": "executiontime",
          "properties": {
            //"always_enabled": true,
            //"threshold": 50,
            "style": "round"
          }
        },
        {
          "foreground": "green",
          "style": "plain",
          "template": "{{ if .SSHSession }}\uf817 {{ end }}{{ .UserName }}@{{ .HostName }}",
          "type": "session"
        },
        {
          "foreground": "red",
          "properties": {
            "root_icon": "root"
          },
          "style": "plain",
          "template": " as \uf0e7",
          "type": "root"
        }
        //{
        //  "foreground": "darkGray",
        //  "style": "plain",
        //  //"template": "| {{ .CurrentDate | date .Format }} \u001b[2 q",
        //  "template": "| {{ .CurrentDate | date .Format }}",
        //  "type": "time"
        //}
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "background": "magenta",
          "background_templates": [
            "{{ if .Root }}red{{ end }}",
            "{{ if not .Segments.Path.Writable }}white{{ end }}"
          ],
          "foreground": "black",
          "leading_diamond": "\ue0b6",
          "style": "diamond",
          "template": "{{ if .WSL }}WSL at {{ end }}{{.Icon}} ",
          "trailing_diamond": "\ue0b0",
          "type": "os"
        },
        {
          "alias": "Path",
          "background": "yellow",
          "foreground": "black",
          "leading_diamond": "<black,yellow>\ue0b0</>",
          "powerline_symbol": "<yellow,black>\ue0b0",
          "properties": {
            "folder_separator_icon": " \ue0b1 ",
            "max_depth": 4,
            "style": "agnoster_short",
            "home_icon": "\uDB80\uDEDC "
          },
          "style": "diamond",
          "template": " {{ path .Path .Location }} ",
          "trailing_diamond": "\ue0b0",
          "type": "path"
        },
        //{
        //  "type": "command",
        //  "style": "plain",
        //  "foreground": "#ffffff",
        //  "properties": {
        //    //"shell": "bash",
        //    "command": "git config user.email"
        //  }
        //},
        {
          "background": "cyan",
          "foreground": "black",
          "leading_diamond": "<transparent,cyan>\ue0b0</>",
          "properties": {
            //"branch_icon": "\uE0A0",
            "commit_icon": "\uF417 ",
            "tag_icon": "\uF412 ",
            "fetch_status": true,
            "fetch_upstream_icon": true,
            "fetch_user": true,
            "untracked_modes": {
              "*": "no"
            }
          },
          "style": "diamond",
          "template": " {{ .UpstreamIcon }} {{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }} {{ .User.Email }}{{ end }} ",
          "trailing_diamond": "\ue0b4",
          "type": "git"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "lightWhite",
          "style": "plain",
          "template": "{{ if eq .Shell \"cmd\" }}\u276f{{ else if .Root }}#{{ else }}${{ end }} ",
          "type": "text"
        }
      ],
      "type": "prompt"
    }
  ],
  "version": 2
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

bash, cmd

Log output

Version: 21.10.2

Shell: bash (5.2.26(1)-release)

Prompt:

                                                                                                                                                     stanio@staniomob
  �]8;;file:C:\Users\stanio�\󰋜 �]8;;\ 
$ 

Segments:

ConsoleTitle(false)                        -   0 ms
Executiontime(false)                       -   0 ms
Session(true)                              -   1 ms
Root(false)                                -   0 ms
Os(true)                                   -   0 ms
Path(true)                                 -   1 ms
Git(false)                                 -   3 ms
Text(true)                                 -   0 ms

Run duration: 14.9362ms

Cache path: C:\Users\stanio\AppData\Local\oh-my-posh

Config path: C:/Users/stanio/AppData/Local/Programs/oh-my-posh/themes/stanio.omp.jsonc

Logs:

[DEBUG] 16:17:23.186 shell.go:Getenv:326 → NO DATA
[TRACE] 16:17:23.186 shell.go:Getenv(TERM_PROGRAM) - 513.9µs
[DEBUG] 16:17:23.186 shell.go:Getenv:326 → C:\Users\stanio\AppData\Local
[TRACE] 16:17:23.186 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 16:17:23.186 shell_windows.go:CachePath() - 0s
[DEBUG] 16:17:23.187 shell.go:Getenv:326 → C:/Users/stanio/AppData/Local/Programs/oh-my-posh/themes/stanio.omp.jsonc
[TRACE] 16:17:23.187 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 16:17:23.187 shell.go:Shell:601 → no shell name provided in flags, trying to detect it
[DEBUG] 16:17:23.192 shell.go:Shell:609 → process name: bash.exe
[TRACE] 16:17:23.192 shell.go:Shell() - 5.7076ms
[DEBUG] 16:17:23.192 shell.go:resolveConfigPath:260 → Cygwin detected, using full path for config
[TRACE] 16:17:23.192 shell.go:resolveConfigPath() - 5.7076ms
[TRACE] 16:17:23.192 shell.go:Init() - 6.7452ms
[TRACE] 16:17:23.192 shell.go:Flags() - 0s
[TRACE] 16:17:23.193 config.go:loadConfig() - 1.0433ms
[TRACE] 16:17:23.193 shell.go:Flags() - 0s
[DEBUG] 16:17:23.193 shell.go:Getenv:326 → NO DATA
[TRACE] 16:17:23.193 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 16:17:23.193 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.193 shell.go:GOOS() - 0s
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.194 shell_windows.go:WindowsRegistryKeyValue:217 → ColorizationColor(DWORD): 0xC450506C
[TRACE] 16:17:23.194 shell.go:Shell() - 0s
[DEBUG] 16:17:23.194 shell.go:Getenv:326 → 5.2.26(1)-release
[TRACE] 16:17:23.194 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 16:17:23.194 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 16:17:23.194 text.go:Render:72 → Rendering template: 
[DEBUG] 16:17:23.194 shell.go:Getenv:326 → NO DATA
[TRACE] 16:17:23.194 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 16:17:23.194 shell.go:Getenv:326 → NO DATA
[TRACE] 16:17:23.194 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 16:17:23.194 shell.go:Flags() - 0s
[TRACE] 16:17:23.194 shell.go:Flags() - 0s
[TRACE] 16:17:23.194 shell.go:Shell() - 0s
[TRACE] 16:17:23.194 shell.go:Shell() - 0s
[TRACE] 16:17:23.194 shell.go:Flags() - 0s
[TRACE] 16:17:23.194 shell.go:Flags() - 0s
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.194 shell.go:Pwd:356 → C:\Users\stanio
[TRACE] 16:17:23.194 shell.go:Pwd() - 0s
[DEBUG] 16:17:23.194 shell_windows.go:58 → C:\Users\stanio
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.194 segment.go:SetEnabled:554 → Segment: Root
[TRACE] 16:17:23.194 shell.go:Pwd() - 0s
[TRACE] 16:17:23.194 shell.go:Pwd() - 0s
[DEBUG] 16:17:23.194 shell_windows.go:58 → C:\Users\stanio
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.194 segment.go:SetEnabled:554 → Segment: Executiontime
[DEBUG] 16:17:23.194 shell_windows.go:58 → C:\Users\stanio
[TRACE] 16:17:23.194 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.194 segment.go:SetEnabled:554 → Segment: Session
[DEBUG] 16:17:23.194 properties.go:GetBool:22 → always_enabled: false
[DEBUG] 16:17:23.194 shell.go:Getenv:326 → NO DATA
[TRACE] 16:17:23.194 shell.go:ExecutionTime() - 0s
[TRACE] 16:17:23.194 shell.go:Getenv(SSH_CONNECTION) - 0s
[TRACE] 16:17:23.194 shell_windows.go:Root() - 0s
[DEBUG] 16:17:23.194 properties.go:GetFloat64:34 → threshold: 500.000000
[DEBUG] 16:17:23.194 shell.go:Getenv:326 → NO DATA
[TRACE] 16:17:23.194 shell.go:Getenv(SSH_CLIENT) - 0s
[TRACE] 16:17:23.194 shell_windows.go:Root() - 0s
[TRACE] 16:17:23.194 shell.go:Shell() - 0s
[TRACE] 16:17:23.194 shell.go:StatusCodes() - 0s
[TRACE] 16:17:23.194 shell_windows.go:IsWsl() - 0s
[DEBUG] 16:17:23.195 shell.go:TemplateCache:782 ↓
    environment: [... ask me if you're looking for something more specific in here...]
[TRACE] 16:17:23.195 shell.go:Pwd() - 0s
[DEBUG] 16:17:23.195 shell_windows.go:58 → C:\Users\stanio
[TRACE] 16:17:23.195 shell_windows.go:IsWsl() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.195 shell.go:User:494 → stanio
[TRACE] 16:17:23.195 shell.go:User() - 0s
[DEBUG] 16:17:23.195 shell.go:Host:511 → staniomob
[TRACE] 16:17:23.195 shell.go:Host() - 0s
[TRACE] 16:17:23.195 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.195 shell.go:Getenv:326 → 1
[TRACE] 16:17:23.195 shell.go:Getenv(SHLVL) - 0s
[TRACE] 16:17:23.195 shell.go:TemplateCache() - 1.0466ms
[DEBUG] 16:17:23.195 text.go:Render:72 → Rendering template: {{ if .SSHSession }} {{ end }}{{ .UserName }}@{{ .HostName }}
[TRACE] 16:17:23.196 shell.go:TemplateCache() - 0s
[DEBUG] 16:17:23.196 text.go:Render:72 → Rendering template: plain
[DEBUG] 16:17:23.196 text.go:Render:72 → Rendering template: plain
[DEBUG] 16:17:23.196 text.go:Render:72 → Rendering template: plain
[DEBUG] 16:17:23.196 shell_windows.go:TerminalWidth:111 → terminal width: 165
[TRACE] 16:17:23.196 shell_windows.go:TerminalWidth() - 0s
[TRACE] 16:17:23.196 shell.go:Shell() - 0s
[TRACE] 16:17:23.196 shell.go:Shell() - 0s
[TRACE] 16:17:23.196 shell.go:Shell() - 0s
[TRACE] 16:17:23.196 shell.go:Shell() - 0s
[TRACE] 16:17:23.196 shell.go:Flags() - 0s
[TRACE] 16:17:23.196 shell.go:Pwd() - 0s
[TRACE] 16:17:23.196 shell.go:Flags() - 0s
[DEBUG] 16:17:23.196 shell_windows.go:58 → C:\Users\stanio
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.196 segment.go:SetEnabled:554 → Segment: Git
[TRACE] 16:17:23.196 shell.go:Pwd() - 0s
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.196 shell_windows.go:58 → C:\Users\stanio
[DEBUG] 16:17:23.196 shell.go:Getenv:326 → C:\Users\stanio\AppData\Local
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[TRACE] 16:17:23.196 shell.go:Getenv(LOCALAPPDATA) - 0s
[DEBUG] 16:17:23.196 segment.go:SetEnabled:554 → Segment: Os
[DEBUG] 16:17:23.196 segment.go:SetEnabled:554 → Segment: Path
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[TRACE] 16:17:23.196 shell.go:Pwd() - 0s
[DEBUG] 16:17:23.196 properties.go:GetString:28 → 
[TRACE] 16:17:23.196 shell.go:Shell() - 0s
[TRACE] 16:17:23.196 shell.go:TemplateCache() - 0s
[TRACE] 16:17:23.196 shell.go:Shell() - 0s
[DEBUG] 16:17:23.196 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 16:17:23.196 properties.go:GetString:28 → 
[DEBUG] 16:17:23.196 properties.go:GetString:28 → 
[DEBUG] 16:17:23.196 shell_windows.go:58 → C:\Users\stanio
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.196 properties.go:GetString:28 → 󰋜 
[DEBUG] 16:17:23.196 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 16:17:23.196 shell.go:PathSeparator() - 0s
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[TRACE] 16:17:23.196 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:PathSeparator() - 0s
[TRACE] 16:17:23.197 shell.go:PathSeparator() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:PathSeparator() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:PathSeparator() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:PathSeparator() - 0s
[DEBUG] 16:17:23.197 properties.go:GetString:28 → NO DATA
[TRACE] 16:17:23.197 shell.go:GOOS() - 0s
[TRACE] 16:17:23.197 shell.go:PathSeparator() - 0s
[TRACE] 16:17:23.197 shell.go:Pwd() - 0s
[TRACE] 16:17:23.197 shell.go:TemplateCache() - 0s
[TRACE] 16:17:23.197 shell.go:StackCount() - 0s
[DEBUG] 16:17:23.197 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 16:17:23.197 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 16:17:23.197 win32_windows.go:isWriteable:311 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 16:17:23.197 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 16:17:23.197 shell_windows.go:DirIsWritable() - 530.3µs
[TRACE] 16:17:23.197 shell.go:TemplateCache() - 0s
[DEBUG] 16:17:23.199 shell.go:CommandPath:553 → C:\Program Files\Git\mingw64\bin\git.exe
[TRACE] 16:17:23.199 shell.go:CommandPath(git.exe) - 2.618ms
[TRACE] 16:17:23.199 shell.go:HasCommand(git.exe) - 2.618ms
[TRACE] 16:17:23.199 shell.go:Pwd() - 0s
[ERROR] 16:17:23.199 shell.go:HasParentFilePath:697 → CreateFile .git: The system cannot find the file specified.
[TRACE] 16:17:23.199 shell.go:HasParentFilePath(.git) - 534.4µs
[DEBUG] 16:17:23.199 properties.go:GetBool:22 → fetch_bare_info: false
[DEBUG] 16:17:23.199 text.go:Render:72 → Rendering template: {{ if .WSL }}WSL at {{ end }}{{.Icon}} 
[DEBUG] 16:17:23.199 text.go:Render:72 → Rendering template:  {{ path .Path .Location }} 
[TRACE] 16:17:23.199 shell.go:TemplateCache() - 0s
[TRACE] 16:17:23.199 shell.go:TemplateCache() - 0s
[DEBUG] 16:17:23.199 shell.go:Getenv:326 → NO DATA
[TRACE] 16:17:23.199 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 16:17:23.199 text.go:Render:72 → Rendering template: {{ if .Root }}red{{ end }}
[TRACE] 16:17:23.200 shell.go:TemplateCache() - 0s
[DEBUG] 16:17:23.200 text.go:Render:72 → Rendering template: {{ if not .Segments.Path.Writable }}white{{ end }}
[TRACE] 16:17:23.200 shell.go:TemplateCache() - 0s
[DEBUG] 16:17:23.200 text.go:Render:72 → Rendering template: diamond
[DEBUG] 16:17:23.200 text.go:Render:72 → Rendering template: diamond
[DEBUG] 16:17:23.200 text.go:Render:72 → Rendering template: diamond
[TRACE] 16:17:23.200 shell.go:Shell() - 0s
[TRACE] 16:17:23.200 shell.go:Shell() - 0s
[TRACE] 16:17:23.200 shell.go:Shell() - 0s
[TRACE] 16:17:23.200 shell.go:Shell() - 0s
[TRACE] 16:17:23.200 shell.go:Flags() - 0s
[TRACE] 16:17:23.200 shell.go:Pwd() - 0s
[DEBUG] 16:17:23.200 shell_windows.go:58 → C:\Users\stanio
[TRACE] 16:17:23.200 shell.go:GOOS() - 0s
[DEBUG] 16:17:23.200 segment.go:SetEnabled:554 → Segment: Text
[TRACE] 16:17:23.200 shell.go:TemplateCache() - 0s
[DEBUG] 16:17:23.200 text.go:Render:72 → Rendering template: {{ if eq .Shell "cmd" }}❯{{ else if .Root }}#{{ else }}${{ end }} 
[TRACE] 16:17:23.201 shell.go:TemplateCache() - 0s
[DEBUG] 16:17:23.201 shell.go:Getenv:326 → NO DATA
[TRACE] 16:17:23.201 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 16:17:23.201 text.go:Render:72 → Rendering template: plain
[TRACE] 16:17:23.201 shell.go:Shell() - 0s
[TRACE] 16:17:23.201 shell.go:Shell() - 0s
[TRACE] 16:17:23.201 shell.go:Shell() - 0s
[TRACE] 16:17:23.201 shell.go:Shell() - 0s
[DEBUG] 16:17:23.201 shell.go:Getenv:326 → C:\Users\stanio\AppData\Local
[TRACE] 16:17:23.201 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 16:17:23.201 shell_windows.go:CachePath() - 0s
[TRACE] 16:17:23.201 shell.go:Flags() - 0s
@stanio stanio added the 🐛 bug Something isn't working label Jun 19, 2024
@JanDeDobbeleer
Copy link
Owner

@stanio thanks, I noticed the same over lunch today, will have a look while adding the native cygPath functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants