mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
simplified λ prompt in lua (#1693)
* replace lambda with $ * simplified $ prompt The $ character for the prompt is defined only once instead of twice * fixed λ prompt
This commit is contained in:
parent
8237b1010c
commit
ff2e09849e
8
vendor/clink.lua
vendored
8
vendor/clink.lua
vendored
@ -40,12 +40,10 @@ local function set_prompt_filter()
|
|||||||
-- orig: $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m
|
-- orig: $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m
|
||||||
-- color codes: "\x1b[1;37;40m"
|
-- color codes: "\x1b[1;37;40m"
|
||||||
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} \n\x1b[1;39;40m{lamb} \x1b[0m"
|
||||||
local lambda
|
local lambda = "λ"
|
||||||
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
|
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
|
||||||
if env == nil then
|
if env ~= nil then
|
||||||
lambda = "λ"
|
lambda = "("..env..") "..lambda
|
||||||
else
|
|
||||||
lambda = "("..env..") λ"
|
|
||||||
end
|
end
|
||||||
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda)
|
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user