This is a custom prompt for Cmder (the alternative console emulator for Windows).
Changes of this Fork:
- Support for virtual environments
- Minor changes on color configs
- Download the
.lua
file, and place it in%CMDER_ROOT%/config
folder. - Open the Windows Terminal
- Go to Settings (Ctrl+,)
- Open the Settings as JSON file (Open JSON File button on the bottom-left)
- Add the following JSON entry under "profiles:list" (replace
C:\\tools\\cmdermini
with%CMDER_ROOT%
folder):
{
"commandline": "cmd /k C:\\tools\\cmdermini\\vendor\\init.bat",
"icon": "C:\\tools\\cmdermini\\icons\\cmder_green.ico",
"name": "Cmder",
"hidden": false,
},
- Save the
settings.json
file and get back to Windows Terminal - On the Startup section, set Cmder as the default profile (optional)
A font with ligatures is required so special symbols are shown correctly. The following fonts from Nerd Fonts were tested:
- FiraCode
- GeistMono
- Ubuntu Mono
After installing the selected font (just extract the ZIP and righ-click on the .ttf
files),
go to Windows Terminal settings, select the Cmder profile, scroll to the Appearance and pick the font on the Font Face option.
You can modify the prompt to display either the full path or only the folder name.
To do this, modify the value of the promptValue
variable in the powerline_prompt.lua
file at this line
The value could be either:
promptValueFull
for full path likeC:\Windows\System32
promptValueFolder
for folder name only likeSystem32
promptValueFull
is the default.
Cmder Source Code and README
What is Clink
Clink API
ANSI Color Sequence
Cmder configurations is stored in %CMDER_ROOT%\config\
You can add files to be loaded during startup in either of these folders
%CMDER_ROOT%\config\profile.d
%CMDER_ROOT%\config
Add a .ps1
file to be loaded for Powershell shells
Add a .bat
or .cmd
files to be loaded for Windows Command shells
Add a .sh
file to be loaded for Bash shells
User-specific configurations should go into files named user-profile
with extensions ps1
, cmd
/bat
, or sh
.
The file %CMDER_ROOT%\vendor\clink.lua
sets the command prompt. See the function set_prompt_filter
.
The prompt value is stored in clink.prompt.value
Drop .lua files into the %CMDER_ROOT%\Config
folder to customize the prompt.
I published this code because it's not nice to keep it to myself. I fix problems that I encounter, and try to fix problems that others encounter if I have time.
This code is provided with the timeless Works on my Machine gurentee.
You can also check out the pull requests page for contributions that didn't make back into this repo. These are fixes to problems I didn't encounter, or features not useful to me, but maybe useful to you.
People are very kind and contribute back fixes and improvements.
This section is to acknowledage their contributions and thank them. If you find their contributions helpful to you, please take the time to thank them directly.
I'd like to thank all who share their code with everyone for their time and effort.