Skip to content

Commit

Permalink
Fix lamda color after a ConEmu change
Browse files Browse the repository at this point in the history
Seems like Maximus5/ConEmu#1288 caused this
  • Loading branch information
Stanzilla committed Oct 29, 2017
1 parent b6042a7 commit a8d3261
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vendor/clink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


-- At first, load the original clink.lua file
-- this is needed as we set the script path to this dir and therefore the original
-- this is needed as we set the script path to this dir and therefore the original
-- clink.lua is not loaded.
local clink_lua_file = clink.get_env('CMDER_ROOT')..'\\vendor\\clink\\clink.lua'
dofile(clink_lua_file)
Expand All @@ -26,19 +26,19 @@ function set_prompt_filter()
local old_prompt = clink.prompt.value
local cwd = old_prompt:match('.*(.:[^>]*)>')
if cwd == nil then cwd = clink.get_cwd() end

-- environment systems like pythons virtualenv change the PROMPT and usually
-- set some variable. But the variables are differently named and we would never
-- get them all, so try to parse the env name out of the PROMPT.
-- envs are usually put in round or square parentheses and before the old prompt
local env = old_prompt:match('.*%(([^%)]+)%).+:')
-- also check for square brackets
if env == nil then env = old_prompt:match('.*%[([^%]]+)%].+:') end

-- build our own prompt
-- orig: $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m
-- color codes: "\x1b[1;37;40m"
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;30;40m{lamb} \x1b[0m"
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m"
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
if env == nil then
lambda = "λ"
Expand Down

0 comments on commit a8d3261

Please sign in to comment.