cmder Mini - Don't Echo Path

Created on 19 Nov 2019  路  4Comments  路  Source: cmderdev/cmder

image
How do you remove the echo every time you press enter within cmder?

Most helpful comment

You have everything on one line:

function my_prompt_filter()
    cwd = clink.get_cwd()
    prompt = "\x1b[1;32;40m{cwd}{git}{hg}{svn}\x1b[1;30;40m{lamb} \x1b[0m"
    new_value = string.gsub(prompt, "{cwd}", cwd)
    clink.prompt.value = string.gsub(new_value, "{lamb}", "位")
end

clink.prompt.register_filter(my_prompt_filter, 1)

image

Or remove the path entirely:

function my_prompt_filter()
    cwd = clink.get_cwd()
    prompt = "\x1b[1;32;40m{git}{hg}{svn}\x1b[1;30;40m{lamb} \x1b[0m"
    clink.prompt.value = string.gsub(prompt, "{lamb}", "位")
end

clink.prompt.register_filter(my_prompt_filter, 1)

image

All 4 comments

I don't understand the question. You sent a screenshot of the cmder prompt hitting enter several times.

How do I remove the "C:\MyData\Software\cmder_mini" echo every time I press enter?

That IS the prompt for Cmder telling you tour current working directory. The prompt is customizable using the lua language that us used by Clink to write the prompt.

You would need to write a custom %cmder_root%\config\prompt.lua to change the way the prompt is written.

You have everything on one line:

function my_prompt_filter()
    cwd = clink.get_cwd()
    prompt = "\x1b[1;32;40m{cwd}{git}{hg}{svn}\x1b[1;30;40m{lamb} \x1b[0m"
    new_value = string.gsub(prompt, "{cwd}", cwd)
    clink.prompt.value = string.gsub(new_value, "{lamb}", "位")
end

clink.prompt.register_filter(my_prompt_filter, 1)

image

Or remove the path entirely:

function my_prompt_filter()
    cwd = clink.get_cwd()
    prompt = "\x1b[1;32;40m{git}{hg}{svn}\x1b[1;30;40m{lamb} \x1b[0m"
    clink.prompt.value = string.gsub(prompt, "{lamb}", "位")
end

clink.prompt.register_filter(my_prompt_filter, 1)

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sathishsoundharajan picture sathishsoundharajan  路  3Comments

justinmchase picture justinmchase  路  3Comments

hyrious picture hyrious  路  3Comments

tfarina picture tfarina  路  3Comments

emesx picture emesx  路  3Comments