-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Is it possible to show the current folder in front of cursor on the current line? #338
Comments
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 If you want to properly override the prompt in a cmd task, just add your own prompt.lua in the 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
|
The above
as mentioned in #1070. If I
How can I solve this? I've looked into the Cmder Version 1.3.14.982 |
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 _
The text was updated successfully, but these errors were encountered: