Is it possible to mimic the standard cmd.exe behavior by keeping the cursor on the same line as the current folder, e.g.,
C:\Folder _
You can change the prompt style in your cmder\vendorinit.bat.

@prompt $P$G.$S$_ part.
Thanks!
Where is that line in the latest version? I cannot find it :(
Starting from Cmder 1.3.0, you will find the prompt definition in vendor\clink.lua (function set_prompt_filter()) if you're using a cmd task, or in vendor\profile.ps1 (function global:prompt) if you're using a PowerShell task.
If you want to properly override the prompt in a cmd task, just add your own prompt.lua in the config folder with this definition :
function my_prompt_filter()
cwd = clink.get_cwd()
prompt = "\x1b[1;32;40m{cwd} {git}{hg} \n\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)
You can then customize the prompt without loosing it when updating Cmder.
New user, not familiar with terminal stuff at all other than some mandatory DOS usage to play games under Windows 3.1 when I was a kid.
Like the OP, I'm used to a single-line prompt, so I tried the Lua example above. It worked, but it also removed all text coloring from the terminal. So I deleted the .lua file, but the coloring hasn't come back. I tried putting the file back and fiddling with the prompt it defines, but nothing I do makes a difference. Likewise, editing _init.bat_ doesn't seem to do anything.
How do I fix this and/or get what I was originally aiming for - single-line prompt with coloring?
I'm sure the problem here is one of those between-keyboard-and-chair deals. Cheers.
For current version (i downloaded on 1 January 2019):
In C:\YOUR_PATH\cmder\vendor\ edit the _clink.lua_ file, just remove the "\n" in the string for cmder_prompt which in my case it was at line 50,
-- local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m"
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \x1b[1;39;40m{lamb} \x1b[0m"
-- local lambda = "λ"
local lambda = "$"
note: the commented one is the original one.
@noxasch Not a good solution as it will be overwritten on update. Instead add the below to a file called %cmder_root%\config\my_prompt.lua:
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)
i'm trying to change the prompt on Version 1.3.11.843, like @noxasch and @daxgames but theres no change.... what i'm doing wrong ?
SORRY:
im using powerline that why was not change anything.
The above my_prompt_filter() approach is great and I've successfully changed the "λ" symbol. However it makes non-ASCII path characters garbled because
clink.get_cwd() is returning a string which is differently encoded than what
clink.prompt.value expects.
as mentioned in https://github.com/cmderdev/cmder/pull/1070.
If I cd to a non-ASCII path it looks like this
D:\PortableApps\Cmder (master)
★ cd "D:\Temp\あいうえお"
D:\Temp\?????
★
How can I solve this? I've looked into the %cmder_root%\vendor\clink.lua file (not familiar with Lua though) and figured maybe I need to cache the original cwd. But if modification to original file is needed then the benefit of creating a new file is gone.
Cmder Version 1.3.14.982
Most helpful comment
@noxasch Not a good solution as it will be overwritten on update. Instead add the below to a file called
%cmder_root%\config\my_prompt.lua: