From 810a3da955abdef51c85cff9651cf02e4c56fd4d Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 2 May 2021 20:54:52 -0400 Subject: [PATCH 1/4] upgrade to clink 1.2.5 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index b552653..9be554f 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -6,8 +6,8 @@ }, { "name": "clink", - "version": "1.1.45", - "url": "https://github.com/chrisant996/clink/releases/download/v1.1.45/clink.1.1.45.1c3985.zip" + "version": "1.2.5", + "url": "https://github.com/chrisant996/clink/releases/download/v1.1.45/clink.1.2.5.5dd017.zip" }, { "name": "conemu-maximus5", From 11fb1b3a505d2bdf047d63631048407f23c0497b Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 2 May 2021 20:56:02 -0400 Subject: [PATCH 2/4] do not rely on config\cmder_prompt_config.lua --- vendor/clink.lua | 60 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/vendor/clink.lua b/vendor/clink.lua index c01d6be..a35c225 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -13,6 +13,34 @@ dofile(clink_lua_file) -- now add our own things... + +local function get_uah_color() + return uah_color or "\x1b[1;33;40m" -- Green = uah = [user]@[hostname] +end + +local function get_cwd_color() + return cwd_color or "\x1b[1;32;40m" -- Yellow cwd = Current Working Directory +end + +local function get_lamb_color() + return lamb_color or "\x1b[1;30;40m" -- Light Grey = Lambda Color +end + + +local function get_clean_color() + return clean_color or "\x1b[1;37;40m" +end + + +local function get_dirty_color() + return dirty_color or "\x1b[33;3m" +end + + +local function get_conflict_color() + return conflict_color or "\x1b[31;1m" +end + --- -- Makes a string safe to use as the replacement in string.gsub --- @@ -65,6 +93,22 @@ local function set_prompt_filter() prompt_lambSymbol = "λ" end + if not prompt_type then + prompt_type = "full" + end + + if prompt_useHomeSymbol == nil then + prompt_useHomeSymbol = false + end + + if prompt_useUserAtHost == nil then + prompt_useUserAtHost = false + end + + if prompt_singleLine == nil then + prompt_singleLine = false + end + if prompt_type == 'folder' then cwd = get_folder_name(cwd) end @@ -87,7 +131,7 @@ local function set_prompt_filter() prompt_lambSymbol = "("..env..") "..prompt_lambSymbol end - prompt = uah_color .. "{uah}" .. cwd_color .. "{cwd}{git}{hg}{svn}" .. lamb_color .. cr .. "{lamb} \x1b[0m" + prompt = get_uah_color() .. "{uah}" .. get_cwd_color() .. "{cwd}{git}{hg}{svn}" .. get_lamb_color() .. cr .. "{lamb} \x1b[0m" uah_value = string.gsub(prompt, "{uah}", uah) new_value = string.gsub(uah_value, "{cwd}", cwd) clink.prompt.value = string.gsub(new_value, "{lamb}", prompt_lambSymbol) @@ -347,9 +391,9 @@ local function git_prompt_filter() -- Colors for git status local colors = { - clean = clean_color, - dirty = dirty_color, - conflict = conflict_color + clean = get_clean_color(), + dirty = get_dirty_color(), + conflict = get_conflict_color() } local git_dir = get_git_dir() @@ -392,8 +436,8 @@ local function hg_prompt_filter() if hg_dir then -- Colors for mercurial status local colors = { - clean = clean_color, - dirty = dirty_color, + clean = get_clean_color(), + dirty = get_dirty_color(), } local pipe = io.popen("hg branch 2>&1") @@ -426,8 +470,8 @@ end local function svn_prompt_filter() -- Colors for svn status local colors = { - clean = clean_color, - dirty = dirty_color, + clean = get_clean_color(), + dirty = get_dirty_color(), } if get_svn_dir() then From d6b5fe8e1d2fef4d8714829f77ce3c3d90a36cdd Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 2 May 2021 20:56:17 -0400 Subject: [PATCH 3/4] CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc61977..77d2fdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ### Changes - Update Git for Windows to 2.31.1 +- Update to Clink 1.2.5 +- Do not rely on having a `%cmder_root%\config\cmder_prompt_config.lua` ### Adds From 59941f5dfa4c00f667875d8de6d686afe8a14766 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 2 May 2021 21:05:58 -0400 Subject: [PATCH 4/4] cleanup --- vendor/sources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/sources.json b/vendor/sources.json index e0ddca1..f2423a4 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -7,7 +7,7 @@ { "name": "clink", "version": "1.2.5", - "url": "https://github.com/chrisant996/clink/releases/download/v1.2.55/clink.1.2.5.5dd017.zip" + "url": "https://github.com/chrisant996/clink/releases/download/v1.2.5/clink.1.2.5.5dd017.zip" }, { "name": "conemu-maximus5",