From 03d0f913ea2dad4596640313a36833a260b8a222 Mon Sep 17 00:00:00 2001 From: dgames Date: Sun, 30 May 2021 07:27:16 -0400 Subject: [PATCH 1/3] fixing branch only --- vendor/clink.lua | 14 ++++++++++++++ vendor/cmder_prompt_config.lua.default | 1 + 2 files changed, 15 insertions(+) diff --git a/vendor/clink.lua b/vendor/clink.lua index c01d6be..2c26d4c 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -350,6 +350,7 @@ local function git_prompt_filter() clean = clean_color, dirty = dirty_color, conflict = conflict_color + nostatus = unknown_color } local git_dir = get_git_dir() @@ -377,6 +378,17 @@ local function git_prompt_filter() return false end end + else + if git_dir then + local branch = get_git_branch(git_dir) + local color + if branch then + color = colors.nostatus + clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..verbatim(branch)..")") + return false + end + end + end -- No git present or not in git file @@ -394,6 +406,7 @@ local function hg_prompt_filter() local colors = { clean = clean_color, dirty = dirty_color, + nostatus = nostatus_color } local pipe = io.popen("hg branch 2>&1") @@ -428,6 +441,7 @@ local function svn_prompt_filter() local colors = { clean = clean_color, dirty = dirty_color, + nostatus = nostatus_color } if get_svn_dir() then diff --git a/vendor/cmder_prompt_config.lua.default b/vendor/cmder_prompt_config.lua.default index 5e59c14..366dc62 100644 --- a/vendor/cmder_prompt_config.lua.default +++ b/vendor/cmder_prompt_config.lua.default @@ -43,3 +43,4 @@ lamb_color = "\x1b[1;30;40m" -- Light Grey = Lambda Color clean_color = "\x1b[1;37;40m" dirty_color = "\x1b[33;3m" conflict_color = "\x1b[31;1m" +unknown_color = "\x1b[1;30;40m" -- Light Grey = No VCS Status Branch Color From b2add2b966ef4e6008ddd8f0a5ce13d1491f053d Mon Sep 17 00:00:00 2001 From: dgames Date: Thu, 10 Jun 2021 20:12:47 -0400 Subject: [PATCH 2/3] prompt config docs --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index b6e18c0..592c19e 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,26 @@ echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh You may find some Monokai color schemes for mintty to match Cmder [here](https://github.com/oumu/mintty-color-schemes/blob/master/base16-monokai-mod.minttyrc). +### Changing Cmder Default `cmd.exe` Prompt Config File + +The default Cmder shell `cmd::Cmder` propmt is customized using `Clink` and is configured by editing a config file that exists in one of two locations: + +- Single User Portable Config `%CMDER_ROOT%\config\cmder_prompt_config.lua` +- Shared Cmder install with Non-Portable Individual User Config `%CMDER_USER_CONFIG%\cmder_prompt_config.lua` + +If your Cmder setup does not have this file create it from `%CMDER_ROOT%\vendor\cmder_prompt_config.lua.default` + +Customizations include: + +- Colors. +- Single/Multi-line. +- Full path/Folder only. +- `[user]@[host]` to the beginning of the prompt. +- `~` for home directory. +- `λ` symbol + +Documentation is in the file for each setting. + ### Changing Cmder Default `cmd.exe` Shell Startup Behaviour Using Task Arguments 1. Press Win + Alt + T From bfe526604dab46edbcd4faa7eaffbd4aaee385dc Mon Sep 17 00:00:00 2001 From: dgames Date: Thu, 10 Jun 2021 20:21:43 -0400 Subject: [PATCH 3/3] revert --- vendor/cmder_prompt_config.lua.default | 1 - 1 file changed, 1 deletion(-) diff --git a/vendor/cmder_prompt_config.lua.default b/vendor/cmder_prompt_config.lua.default index 366dc62..5e59c14 100644 --- a/vendor/cmder_prompt_config.lua.default +++ b/vendor/cmder_prompt_config.lua.default @@ -43,4 +43,3 @@ lamb_color = "\x1b[1;30;40m" -- Light Grey = Lambda Color clean_color = "\x1b[1;37;40m" dirty_color = "\x1b[33;3m" conflict_color = "\x1b[31;1m" -unknown_color = "\x1b[1;30;40m" -- Light Grey = No VCS Status Branch Color