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

prompt: missing space between path and scm state #2654

Closed
geekrumper opened this issue Jan 21, 2022 · 7 comments
Closed

prompt: missing space between path and scm state #2654

geekrumper opened this issue Jan 21, 2022 · 7 comments

Comments

@geekrumper
Copy link

geekrumper commented Jan 21, 2022

Purpose of the issue

  • [x ] Bug report (encountered problems/errors)

Version Information

Version 1.3.19.1181

Windows 10 Enterprise (19042.1415)

Description of the issue

The prompt is missing a space between folder and scm state.

Actual behavior:
C:\work\projects\test(develop -> origin)

Expected behavior:
C:\work\projects\test (develop -> origin)

I took the liberty to manually add a space in clink.lua (169,63), but I'm pretty sure that is not the right spot, since there were no changes in that file a while ago. After reading all about prompts, I was not able to fix this behavior via config and thus using vendor scripts.

@geekrumper geekrumper changed the title Propmt: Missing space between path and scm state prompt: missing space between path and scm state Jan 21, 2022
@geekrumper
Copy link
Author

geekrumper commented Jan 31, 2022

Is this intentional? Can it be fixed somewhere else in the code? I was hesitant to create a pr with the mentioned "fix".

@daxgames
Copy link
Member

Probably intentional. I did not go back and look to see if/when it might have changed.

@daxgames
Copy link
Member

You could 'fix' it using a custom %cmder_root%\config\prompt.lua

@chrisant996
Copy link
Contributor

chrisant996 commented Feb 1, 2022

The regression was introduced on Apr 16, 2021 by commit 0ef76ee.

Before that commit, the prompt had space between {cwd} and {git}...:

    local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m"

After that commit, the prompt no longer has a space there:

    prompt = uah_color .. "{uah}" .. cwd_color .. "{cwd}{git}{hg}{svn}" .. lamb_color .. cr .. "{lamb} \x1b[0m"

It was an accidental regression, and can be fixed in the current code by inserting a space immediately before {git} in this line:

    local version_control = prompt_includeVersionControl and "{git}{hg}{svn}" or ""

Finding it was very quick for me, but making a PR would take time that I don't have.
Someone else can make a PR with a fix, though.

@chrisant996
Copy link
Contributor

chrisant996 commented Feb 1, 2022

@geekrumper

I took the liberty to manually add a space in clink.lua (169,63), but I'm pretty sure that is not the right spot, since there were no changes in that file a while ago. After reading all about prompts, I was not able to fix this behavior via config and thus using vendor scripts.

That is exactly the correct/best fix. 🙂

@geekrumper
Copy link
Author

@chrisant996

pr #2661 is out. Thank you for this wonderful project. I've been using this since ages....

daxgames added a commit that referenced this issue Feb 3, 2022
Fix #2654: blank space added between {cwd} and version_control variable
@DRSDavidSoft
Copy link
Contributor

I know this has already been fixed, but I'd like to suggest prepending the space before each {git}, {hg} and {svn} part for reasons that are discussed here: #2738

daxgames added a commit that referenced this issue Sep 9, 2022
Related to #2654: Move space from "{git}{hg}{svn}" to individual parts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants