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

Modifying [cmder_prompt_config.lua] does not change "λ" prompt in bash/powershell #2716

Open
SkinAir opened this issue Jul 7, 2022 · 8 comments

Comments

@SkinAir
Copy link

SkinAir commented Jul 7, 2022

图片
图片

@SkinAir
Copy link
Author

SkinAir commented Jul 7, 2022

Found many articles, but failed to modify them“ λ "And line breaks, thank, help me answer

@daxgames
Copy link
Member

I don't understand the issue. I change this file and my prompt changes.

Please clarify.

@DRSDavidSoft
Copy link
Contributor

The issue is that cmder_prompt_config.lua is for cmd.exe/clinks shell while for bash, PS1 needs to be edited instead:

PS1="$PS1"'λ ' # prompt: always λ

Currently it seems that the ~/.config/git/git-prompt.sh file needs to be edited/created and lines 41-71 be copied into it in order to change the prompt.

@daxgames The documentation needs to be updated in order to make this clear that the .lua files affect only the clink shell and not the bash shell. In the meantime, I added it to the wiki.

@daxgames
Copy link
Member

daxgames commented Oct 9, 2022

@DRSDavidSoft I did not even know that was a thing. It is more a Git-for Windows convention since cmder/vendor/git-prompt.sh most likely came from there and just we changed the $ to λ character.

I think it would be better to take advantage of this, now that we know about it, and make a more Cmder like solution and put user prompt configurability like we have for cmd/lua prompts into $CMDER_ROOT/config/cmder_prompt_config.sh

@DRSDavidSoft
Copy link
Contributor

@daxgames Good idea! In fact I think if we could leverage the same .lua files for both Bash and Powershell, it'd be awesome to share the cmder_prompt_config file across different shells. This will however require a lua parser for both of those environments. In #1695, I proposed a shared config storage (e.g. ala .ini-style files, or even json) that could be parsed by all three environments, or so.

Other than that, we could use separate cmder_prompt_config . sh, lua, ps1 files, too.

@chrisant996
Copy link
Contributor

chrisant996 commented Oct 10, 2022

How about a simple X = Y file format that can be read (or maybe included) but all the various scripting languages?

That way the configuration could be independent from script languages.

I.e. configure once, and take effect in all the shells.

@daxgames
Copy link
Member

@chrisant996 exactly what I was thinking.

@chrisant996
Copy link
Contributor

chrisant996 commented Jan 12, 2023

Clink v1.4.8 looks like it may have solved the width problems with the lambda character in the prompt.

Well, maybe not entirely -- the input line no longer gets garbled, but also there is no longer a space after the lambda. There's nothing Clink can do about that, though.

@DRSDavidSoft DRSDavidSoft changed the title modifying [cmder_prompt_config.lua] this file cannot be changed "λ" Modifying [cmder_prompt_config.lua] does not change "λ" prompt in bash/powershell Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants