cmder
cmder copied to clipboard
Modifying [cmder_prompt_config.lua] does not change "λ" prompt in bash/powershell
Found many articles, but failed to modify them“ λ "And line breaks, thank, help me answer
I don't understand the issue. I change this file and my prompt changes.
Please clarify.
I don't understand the issue. I change this file and my prompt changes.
Please clarify.
thank you.
The issue is that cmder_prompt_config.lua
is for cmd.exe/clinks shell while for bash, PS1
needs to be edited instead:
https://github.com/cmderdev/cmder/blob/711fe2895e5331e183ee72c200a3f67349f1fa12/vendor/git-prompt.sh#L71
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.
@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
@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.
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.
@chrisant996 exactly what I was thinking.
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.