Cmder: Custom cmder prompt

Created on 3 Mar 2018  Â·  7Comments  Â·  Source: cmderdev/cmder

How to make look like this?
image
Thank you very much...

All 7 comments

This is my example code

    local cmder_prompt = "\x1b[1;32;1;40m{lamb} \x1b[36m"..dir.." \x1b[32;1;1m{git}{hg}{svn} \x1b[0m"
    local lambda

    -- char set • →
    cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
    if env == nil then
        lambda = "→"
    else
        lambda = "("..env..") →"
    end
    clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda

image

How to edit the git:(master) section... Thank you @gucong3000 ...

Hi @gucong3000 Ive been trying to achieve this.
But how to make the prompt like this → folderName git(branchname) instead of → folderName git(branchname -> origin). Where to remove the -> origin?
Thank you...

@victormongi The easiest way while not really correct would be to delete the file '%cmder-root%\vendor\clink-completions\git_prompt.lua'.

I am working on a more corrwct way to do this.

Thank you @daxgames it just work...
image
If you get the more correct way, please share...

just as a reference for googlers:
small tutorial how to add a custom prompt to your commander
https://dev.to/c33s/how-to-add-a-custom-prompt-to-cmder-gb2

@maintainers should we add something like this to the wiki?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jenisys picture jenisys  Â·  3Comments

GlassGruber picture GlassGruber  Â·  3Comments

sathishsoundharajan picture sathishsoundharajan  Â·  3Comments

justinmchase picture justinmchase  Â·  3Comments

bmeverett picture bmeverett  Â·  3Comments