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

Escaped characters in path are replaced with whatever they translate to, but only in git bash, windows-terminal #738

Closed
2 tasks done
mkvlrn opened this issue May 24, 2021 · 2 comments · Fixed by #741
Closed
2 tasks done

Comments

@mkvlrn
Copy link

mkvlrn commented May 24, 2021

Prerequisites

  • I have read and understand the CONTRIBUTING guide
  • I looked for duplicate issues before submitting this one

Description

The clickable path in the terminal (for example D:\dev) works fine on a powershell core instance, but it breaks in git bash:

image
image

This path, for example, D:\dev shows normally on powershell, but the "\d" part of it becomes "Mon May 24", the current day.
It also does not happen when git bash is used inside vscode, only in windows-terminal. Happens with some other themes as well, but pixelrobots is the one I use.

Environment

  • Oh my Posh version: 3.156.0
  • Theme: pixelrobots
  • Operating System: Windows 10 64-bit 20H2 Build 19042.985
  • Shell: Git Bash (git version 2.31.1.windows.1)
  • Terminal: Windows Terminal 1.7.210419001-release1.7

Steps to Reproduce

  1. Install oh-my-posh with scoop
  2. Configure git bash by adding eval "$(oh-my-posh --init --shell bash --config 'D:\\scoop\\apps\\oh-my-posh\\current\\themes\\pixelrobots.omp.json')" to ~/.bashrc (D:\scoop is my scoop home)
  3. Navigate to D:\dev

Expected behavior: Clickable path in terminal should work "unescaped" (?), like it works with powershell core

Actual behavior: Clickable path in terminal replaces some escaped characters (such as "\d" with current day), producing incorrect file paths

@lnu
Copy link
Contributor

lnu commented May 25, 2021

The issue is only with bash.... how did you configure your path to be "d:" in git bash?

Same for any segments:

{
      "type":"text",
      "style":"plain",
      "properties": {
            "text": "\\d"
      }
}

https://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html

lnu added a commit to lnu/oh-my-posh that referenced this issue May 25, 2021
lnu added a commit to lnu/oh-my-posh that referenced this issue May 25, 2021
lnu added a commit to lnu/oh-my-posh that referenced this issue May 25, 2021
lnu added a commit to lnu/oh-my-posh that referenced this issue May 25, 2021
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants