The `string.gsub()` function in Lua always uses Lua patterns (which are
similar to regular expressions). Cmder's custom prompt wants to perform
simple plain text find/replace operations on strings. `string.gsub()`
is the right Lua function for that, but since it always uses Lua
patterns it's necessary to apply escaping to the input strings otherwise
they can get misinterpreted and cause runtime errors.
For example, if the current working directory name contains a percent
sign, such as literally "My%20Home".
This change fixes that. It introduces a helper function `gsub_plain()`
which behaves like `string.gsub()` but applies appropriate escaping to
convert the plain text input strings into the corresponding Lua
patterns so that it can achieve plain text find/replace operations.
It also introduces separate helper functions for escaping the `find` and
`replace` parameters for `string.gsub()`, since they have different
escaping rules.
* Use CodeQL Scanning
* run on windows
Signed-off-by: Martin Kemp <me@martinke.mp>
* Use our build scripts
Signed-off-by: Martin Kemp <me@martinke.mp>
Signed-off-by: Martin Kemp <me@martinke.mp>
Holding ^C made git.exe hang while cmd.exe (Clink) updated the prompt.
The prompt script had three problems:
1. It invoked `git config` every time a prompt was displayed, to
figure out where to skip invoking `git status`. But it even did
that if the current directory wasn't part of a git repo.
2. It invoked `git config` two times for every single prompt, to
attempt to improve performance if the user disables `git status`
coloring. But two times for every single prompt is expensive, so
it has the opposite effect in the general case, and noticeably
degrades performance.
3. It invoked `git config` using a blocking call, instead of using the
async prompt support in Clink. That significantly reduced the
benefit of having used async prompt filtering for `git status`.
Now the `git config` invocations use async prompt filtering, which lets
the prompt display instantaneously. It also now uses a timer to avoid
invoking `git config` repeatedly when new prompts show up in rapid
succession.
Also, the `cmderGitStatusOptIn` variable is no longer leaked into the
Lua global namespace.
These changes resolve the issue: holding ^C is very fast and no longer
causes git.exe to hang.
use conemu-msys2-64 connector would help to solve some display problems under Git Bash like character/cursor drifting, `tmux` display wrong, and so on. As the default profile is hardcoded and ConEmu upstream has solved it by using msys-connector, please add it.
* use "PS" instead of no-width "$([char]0x200B)" character in prompt (credit @skycommand)
* fixes additional space after the lambada and before the path
* display "PS" before path to distinguish between PowerShell and CMD
Add new setting value prompt_overrideSvnStatusOptIn to cmder_prompt_config.lua.default to control of asynchronous svn status update should be used with clink
* Fix start errors in path with ()
* Fix start errors in path with ()
* Fix start errors in path with ()
* Fix start errors in path with ()
* remove quotes from debug_output messages
* remove quotes from debug_output messages
* remove quotes from debug_output messages
* discovery newer git version
* new git path config for powershell
* xxx
* add isGitShim
* fix no git found in path
* debug
* revert not ps1 changes
* cleanup
* final
* spacing
* fixes
* cleanup
* cleanup
* timer for Powershell
* fixes
* fixes for git path settings
* grab vendor/bin/alias.cmd from master
Co-authored-by: Dax T. Games <dtgaes@kinggeek.org>
Co-authored-by: dgames <dgames@dtg.local>
If the path variable contained values with an ampersand character (such as in the case of MySQL), the string splits by this character, and tries to execute what follows as a separate command.
All occurrences of the set command containing %PATH% should be wrapped in quotation marks
The Cmder prompt normally includes version control info, which involves
running some potentially expensive commands. The cmder-powerline-prompt
project (and maybe other projects) replaces the Cmder prompt and runs
the same potentially expensive commands -- so expensive commands get run
twice!
This change makes it possible for the user and/or other scripts to
disable the version control part of the built-in Cmder prompt.
https://github.com/chrisant996/cmder-powerline-prompt
Setting `prompt_overrideGitStatusOptIn = true` will override the
`cmder.status` and `cmder.cmdstatus` git config settings and run the git
prompt status commands in the background. But it only takes effect when
using Clink v1.2.10, since that's required in order to run prompt update
commands in the background.
`git status` and `git diff` can be slow in large repos. Clink v1.2.10
and higher support using Lua coroutines to do expensive parts of prompt
filtering in the background. When the expensive parts complete, the
prompt gets refreshed.
This means even large repos can have fast prompts PLUS git status all
the time!
This change should be backward/forward compatible with both older and
newer versions of Clink (of course only newer versions will gain the
benefit).
The default setting for path enhancing is appending,
so the provided unix tools don't overwrite windows tools we may want to keep.
For Git this is undesired behavior, though, as we just compared git versions
to decide which one we want to use. The git directory thus needs to be prepended
to the path to make sure a call to git uses the version we selected.
It is hard to spot without the brackets, but the last else block - that resets %test_dir% and
logs in verbose mode that an older user git version will be ignored - can't actually be reached.
The else block is considered to belong to the if clause "if exist "%test_dir:~0,-4%\cmd\git.exe""
that will only ever be executed if ERRORLEVEL is greather than or equal to 0, thus if the test fails,
the following else if clause "else if ERRORLEVEL 0" will always succeed and the last else block will be ignored.
Using the vendored git version may still have worked because %GIT_INSTALL_ROOT% isn't set either way,
but to enable the log message I reordered if-else-clauses and brackets in the way I think the
original author intended them to work.
%errorlevel% was always 0, even if the vendored git version was more current than the installed one
Usually exiting a batch script with "exit /b exitCode" as used in :compare_versions
sets %errorlevel% to the specified exit code
However, this may not work if %errorlevel% was set before with "Set errorlevel="
I didn't find the location where this might have happened,
but I saw the consequence of %errorlevel% always being 0
Thus I decided to use ERRORLEVEL instead as this will always work regardless of environment variable
For more information check https://ss64.com/nt/errorlevel.html
The startup time duration is calculated wrongly ( at least for me, on Windows 1909, with CmderMini 1.3.15.1010 ). I got something like "Elapsed Time: 80:36:1.00 (290161.00s total)" printed into the cmder consle window. I can be solved by quoting the time measures taken in `init.bat`.
It seems that `time.cmd` fails in recognizing two arguments. In fact it did split the first time measure into two arguments and ignored the second time measure.
Example:
from the two time measures
λ echo %CMDER_INIT_START% %CMDER_INIT_END%
12:53:44,34 12:53:54,04
The call to `time.cmd` created following output (i added echo commands to print variables start and end right after they got assigned the arguments)
start: 12:53:44
end: 34
* Add bare doubledash command line option
The '--' parameter is a common POSIX-style option. All command-line parameters after the double dash will be joined by a space and forwarded to conemu.
* add bare doubledash command line option
The "--" option indicates that the remaining portion of the command line is forwarded to conemu. Quotes and spacing is retained.
* move all doubledash related code together
* remove unused variable
add that to settings.json
`"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/K",
"%CMDER_ROOT%/vscode.bat",
]`
for using cmder inside vscode
Per our email discussion, I have updated the HG prompt code to use the '-ib' option to 'hg id' so the branch name is always available, regardless of the state of the working copy.
In `string.gsub()`, the `%` character has special meaning and must be escaped to be treated verbatim, otherwise the "invalid use of '%' in replacement string" warning will show up.
This adds a verbatim() function for that purpose. It fixes this warning for situations where `'%` characters are in the current path (cwd), version control branch names, or in the previous `PROMPT` set by the user.
The below enables Cmder Fast Init mode for `cmd.exe` sessions. This is more like the Cmder 1.3.5 init process. See issue #1821
Cmder Fast Init mode bypasses or disables the following Cmder 1.3.6+ features:
* Git root and version detection. Defaults to `%cmder_root%\vendor\git-for-windows` if it exists.
* Path enhance validation before path modify so `%Path%` enhancements are forced.
* Recursive path add for `"%CMDER_ROOT%\bin"`
* Recursive path add for `"%CMDER_USER_BIN%\bin"` if `/c [user_config_folder` is specified.
* `/d` switch to enable debug output.
* `/v` switch to enable debug output.
Add `/f` to Cmder task as shown below t enable fast init:
_Note 1: This setting is invalid in Cmder `Powershell` and `Bash` sessions~_
_Note 2: Add `/t` also to see init timer output_

Cuts ~2.4 seconds off of init time.

If the git found is a shim, we need to follow the path to the actual git
directory to set the GIT_INSTALL_ROOT variable.
This happens when installing git via scoop for example.
## Rename user-profile.* user_profile.* to resolve#1806, #1675
* This is a backward compatible fix and will automatically and silently rename users '%cmder_root%/config/user-profile.\*' to '%cmder_root%/config/user_profile.\*' and '[user_specified_config_root]/user-profile.\*' to '[user_specified_config_root]/user_profile.\*' if the sources exist.
* Cmder.exe does this for cmd.exe sessions.
* The init scripts for bash and Powershell handles it for these shells
Fixes Powershell 5.1 error when Windows Software Restriction Policy is enabled:
bin\vendor\profile.ps1 : Cannot dot-source this command because it was defined in a different language mode. To invoke this command without importing its contents, omit the '.' operator.
At line:1 char:1
+ . 'bin\vendor\conemu-maximus5\..\profi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [profile.ps1], NotSupportedException
+ FullyQualifiedErrorId : DotSourceNotSupported,profile.ps1
Fixes Powershell 5.1 error when Windows Software Restriction Policy is enabled:
bin\vendor\profile.ps1 : Cannot dot-source this command because it was defined in a different language mode. To invoke this command without importing its contents, omit the '.' operator.
At line:1 char:1
+ . 'bin\vendor\conemu-maximus5\..\profi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [profile.ps1], NotSupportedException
+ FullyQualifiedErrorId : DotSourceNotSupported,profile.ps1
with this commit, the build script extracts the latest version string found in `CHANGELOG.md`, and then creates appropriate resource files for the executable compilation
these functions can be used to a) extract the version from `CHANGELOG.md` and b) create a .rc2 file from the `sample` template by replacing its content
Purpose:
- Prevent duplicated/similar issues
- Explain the suitable repo for each issue, avoiding ConEmu issues here.
- Help users to provide a better explanation to identify the problem
@MartiUK: Squashing to avoid adding multiple "fixed" commits
* add args to init.bat
* adding args to cmder launcher
* reworked command line parsing and added a /C [path] arg for individual user config location
* removed unnecessary includes
* make shell init scripts work with CMDER_USER_CONFIG
* update tasks and readme.md
* fix git version check
* readme updates
* add register/unregister back in
* fixed git version again
* removed error if user defines user-aliases store file was not present an init.bat launch
* added enhance_path method to only update path if required
* added enhance_path method to only update path if required
* fixed a path prepend issue in enhance path
* init.bat with args is executed outside cmder/conemu sets cmder_root properly. Thanks @DRSDavidSoft
* fixed enhance path append issue
* implements recursive `/bin` path enhancing.
https://github.com/cmderdev/cmder/issues/1624
* added max depth
* changes command line arg to max_depth
* set max_depth default
* readme.md updates
* add back cmder /c [path] arg so it can be used with admin sessions since the env is not shared.
* readme.md updates
* fix /c setting of cmder_user_config
* changelog and readme
* remove bad arg
* fixed command line parsing and updated command line help on error
* Fixed ConEmu.xml file handling so it works again
* Added default user config root location if '/c' is specified and next arg is not another arg
* Replaced the git version comparison mechanism with actual version comparing
* Add notes regarding the git comparison method
Added a simple mechanism to call and compare the user installed git version against the vendored git version, rather than checking if the `git.exe` executable is located in a `/bin` directory.
This fixes false warnings by actually testing if the user installed git is older, or more recent.
Added a small note regarding how the `init.bat` works, and where to put custom `git.exe` binaries as well as where to find the Minified Cmder.
* Fix alias.bat handling "user-aliases.cmd" with spaces
This fixes the alias command when user-aliases.cmd is located in a path with spaces (like when Cmder is installed into the program-files directory).
I've also made the alphabetical case of the ALIASES variable consistent.
* address review comments
"d" switch specified along with "-new_console" flag in default tasks
commands made them to override chosen startup directory (effectively
ignoring it), therefore it is removed. Closes#920, closes#1024,
closes#1097, closes#1303.
Aliases such as `ls` may have been overridden in the user's profile script and the resulting behavior may be different from `Get-ChildItem`. For example binding `ls` to GNU `ls.exe` generates an error if there are no matching files.
cmder should not be installed in `C:\Program Files` because it would need Administrator privileges to update configuration. This commit adds documentation to the installation instructions as described in #1200.
* Fix Cmder not changing to CMDER_START
Fix to allow Cmder to change to different startup directory if already on the same drive as CMDER_START
possibly relevant: HOME != USERPROFILE
* make "Cmder Here" work in more cases
integrated suggestion from comments (test for trailing backslash to prevent doubling of trailing backslash)
integrated suggestions from #1456: switching ```cd /d``` over to ```pushd``` to get support for UNC-paths
* replaced 'cd /d' with 'pushd'
replaced two more instances of 'cd /d' with 'pushd' to support network paths.
Also added double quotes to the use of '%USERPROFILE%' to prevent issues with spaces.
I also noticed that 'pushd', in contrast to 'cd /d' does not require the trailing backslash for drive roots (on Win7). Therefore I removed the trailing backslash check.
* Don't assume / is needed at end
* Update init.bat
(and some comments on the user-profile.cmd file)
Inspired by the comments from https://github.com/cmderdev/cmder/issues/193 and my personal need to use pageant instead of OpenSSH authentication agents (which is more Window user-friendly), I have used this approach which works as expected.
Keeping the spirit of the current scripts, I left it disabled, and with some comments explaining what they all do.
(and some comments on the user-profile.cmd file)
Inspired by the comments from https://github.com/cmderdev/cmder/issues/193 and my personal need to use pageant instead of OpenSSH authentication agents (which is more Window user-friendly), I have used this approach which works as expected.
Keeping the spirit of the current scripts, I left it disabled, and with some comments explaining what they all do.
1. Changed " --login -i"" to "" --login -i" in ConEmu
2. Closed quotation in "alias.bat :p_del doskey" command of "%ALIASES%"
Suppose %CMDER_ROOT% is "C:\Program Files\cmder",
this BUG will be raised while we exec command of
"unalias xxx"
or creat terminal "{bash::bash}"
and "{bash::mintty}",
it will throws an error like:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
If the Install-Module command is available, do not include the bundled
module path containing a deprecated version of PSGet. Recent powershell
versions include PowerShellGet as standard module installer.
Resolve#1318.
Currently the "history" command in Cmder prints commands without any index associated with any command, so you can copy/paste a command or use "!!" to execute a command from the history but, unlike BASH, you can't do "!<command_index>".
"cat" has a switch, "-n", which prints line numbers of the file being printed. This, in conjunction with "history_io=3" in Clink settings (to read/write history when editing a command") works just like BASH, i.e., you can use the index printed next to a command in the history to execute that command as "!<command_index>".
Currently the "history" command in Cmder prints commands without any index associated with any command, so you can copy/paste a command or use "!!" to execute a command from the history but, unlike BASH, you can't do "!<command_index>".
"cat" has a switch, "-n", which prints line numbers of the file being printed. This, in conjunction with "history_io=3" in Clink settings (to read/write history when editing a command") works just like BASH, i.e., you can use the index printed next to a command in the history to execute that command as "!<command_index>".
This defines the default prompt variables ($PrePrompt, $PostPrompt,
$CmderPrompt, and $Prompt) before running the custom scripts (user-profile.ps1
and profile.d/*.ps1), and then saves those prompt values after running the
custom scripts. This gives the custom scripts and opportunity to override the
prompt code blocks.
This now opens the possibility for profile.d/*.ps1 scripts to affect the
prompt, and also allows both user-profile.ps1 and profile.d/*.ps1 scripts to
overwrite the $Prompt script block and overwrite the prompt behavior entirely.
Posh-Git before this release does not export `Write-VcsStatus` thus
powershell's autoloading cannot find the reqired module for the function.
note that `get-module -listAvailable` can return an array of multiple
versions.
E.g., if ${CMDER_ROOT} is /c/Users/Foo Bar/cmder,
the following errors will occur:
bash: pushd: /c/Users/Foo: No such file or directory
bash: [: /c/Users/Foo: binary operator expected
bash: /c/Users/Foo: No such file or directory
clink.get_cwd() is returning a string which is differently encoded than what
clink.prompt.value expects. This results in garbled path names if the path
condains non-ASCII chars. The (arguable hacky) solution is to parse the old
prompt for the current directory (which breaks if the user sets a PROMPT env var
which is incompatible to the regex used here...).
Also parse out a environment name set by systems like virtualenv or conda: this
could be done more specifically by targeting each such system and using the
usually set environment variable but this would mean that we would have to do
that for each and every such system out there and that is probably not a sane
idea...
This keeps the PROMPT variable as is and changes the prompt to the cmder style
in the clink code.
This has two advantages:
* opening a cmd in a cmder session will now show the old prompt code instead of
a ugly raw prompt without the replacements. This led to ugly output when a
batch file echoed their content (e.g `conda build recipe/`).
* when a command rewrites the prompt (e.g. an activate in a virtualenv), these
command sometimes simply overwrites the PROMPT so that the cmder enhancements
were not anymore in place. Now we simply don't care and overwrite it with our
stuff in the clink part. This might mean that a user has to install a lua
script so that e.g. conda environments are visible on the prompt.
Add a pre and post function hook around the Cmder prompt.
Specify the cmder prompt as a function that could be replaced by a user.
Write a friendly message when the user profile template is created.
Create the user profile with cmder prompt hooks ready to use.
It was concerning to run any function with a specific name every prompt
with no guarantee it remains what it was initally created as.
Core functions have been explicitly called from their
namespace like Microsoft.PowerShell.Utility\Write-Host to try and prevent
clobbering.
User supplied functions are passed in as script blocks, created as the
session runs the profile script. By creating them as constants these
function names cannot be declared again for the duration of the process.
Since the prompt function already exists by this time, set the readOnly
flag so to re-declare the prompt requires the use of -force.
It is hoped these changes limit what could be the risk of any script
redefining functions that are called automatically without user intent or
input.
There were problems when a path contained a parenthesis like `C:\temp\test (test)\`
As a precaution, quote all variables when they are used in echo or set.
This should prevent errors like
https://github.com/cmderdev/cmder/issues/935
https://github.com/cmderdev/cmder/issues/937
I've no idea why this happens, but it shouldn't hurt anyway...
Join-Path won't add "\"'s without the use of a delimeter. In this case there is no delimiter and as a result the script will fail when it tries to look up $CmderModulePath.
The idea is:
* if the users points as to a specific git, use that
* test if a git is in path and if yes, use that
* last, use our vendored git
We don't make any attempt to guess a different location, if a user wants their
own git install, they have to choose "add git to path".
Also check that we have a recent enough version of git (e.g. test for
<GIT>\cmd\git.exe)
This reverts commit 728e83a85bea6ad7b4ddda0b960c443e3ef9f737.
The problem with *always* setting CMDER_START is that this makes the
`-new_console:d:%USERPROFILE%` in the conemu task definitions unnecessary, as
this is now always overwritten as CMDER_START is set. This also means that a
very visible conemu UI for setting the startup dir does not work anymore which
might leave the user puzzled why.
This is to set CMDER_START to home when no directory is given.
This is to ensure it is set even though it will default to the home
directory anyway.
It’ll allow users to use CMDER_START even if started without a path.
4bfdf04d59dab80e1ce76d7125c546006273e188 moved all clink config files
to vendor/ and therefore the files in config/ were not used and .history
was also moved to vendor/.
The new arrangement uses `--script` to load our own clink.lua file which in
turn as the first thing loads the original clink.lua file. The user defined
files are again in config/. As clink regenerates these files, if they are not
present, this also means that we don't need to include the settings file
in the git repo and therefore don't overwrite it on updates.
CMDER_START should always be set as a result of either:
1. The user passes a directory to cmder.exe using `/START $DIR`
- or -
2. Sets CMDER_START as a default environment variable.
Fixes#772
The new system works by setting "CMDER_START" if a cmder.exe gets a
startup path. The rest is then implemented in the profile.ps1 and init.bat.
The new system works as follows:
1.If a startup path is given, cmder.exe sets this as `CMDER_START` and the
startup scripts change to that directory.
2.If the usere sets a `CMDER_START` environment variable and this is not
overwritten by cmder.exe, this variable is taken as the startup
directory by the startup scripts.
3.If not such path is give, the conemu startup dirs is the winner, as the
startup scripts don't change anything.
If having a long line of input in histroy, which went on into the
second row and using <up> to get back to it, you got the effect
that the input was split over three lines: "text, empty, text",
but using the arrows do move to the front of the first line was
moving the cursor in the second (empty) row. You could change
the text, but you needed to do it "in the dark". No idea why
s/os.execute/is.popen/ fixes this, but it does.
Partly adresses https://github.com/cmderdev/cmder/issues/749
As the build script must be executed from the `<projectroot>/scripts`
directory anyway we can assume `util.ps1` is as the same path as
`build.ps1` and just reference the current folder.
added personal files to .gitignore so they never get uploaded to the repo and added support for msys2 bash in the new git for windows
added autocreate of config/user-cmder.sh if iot does not exist and added it to the .gitignore
Added tasks: cmd::Cmder, cmd::Cmder as Admin, bash::bash, bash::bash as Admin, bash::mintty, bash::mintty as admin, powershell::powershell, powershell::powershell as Admin. Set default task to cmd::Cmder. Cot rid of init.bat running before /bin/bash, fixes double exit requirement
Added running git for windows post-install.bat on first cmder launch
fixed file/path not found errors when launching powershell as admin
fixed file/path not found errors when launching bash/mintty as admin
fixed PATH in vendor/cmder.sh
Added sourcing ~/.bashrc if it exists.
changed .gitignore to ignore anything with path of config/user-*
removed my personal files from .gitignore, left in config/user-*
Make sure $CMDER_ROOT does not have a trailing '/'
%CMDER_ROOT% does not have trailing '\'. allow user to specify a conemu.xml on the command line
Removed '\' from %CMDER_ROOT%
This increases performance of git prompt filter by fetching branch name directly from `.git/HEAD` file instead of spawning `git` process. Apart from increasing performance this may also solve potential problems with `git` output, as reported in https://github.com/cmderdev/cmder/issues/692
Fixes#79. Uses Download-File function from d654a53ec43038c42344f9cdbe0abc5b8ff9b387
Create appveyor.yml
Should send build notifications to gitter as well.
Adds appveyor build status badge.
Always compile launcher for AppVeyor
This is to catch any errors that may be caused by changes to the launcher or any outside scripts.
Developers can test the build process without needing to recompile a new
launcher exe. This saves some setup steps to get a new developer started.
Also warn that this build can't be release as by definition it can't be
fully tested.
Up to now, init.bat would be overwritten when a user updated
Cmder. The new mechanism will create a new (mostly empty) file
for the user to enter commands which will then be executed on
each following startup.
Function must be run as an administrator since we're touching the
registry.
A neat by product is that users can now re-run this command and set custom
icons.
I'm not sure what the `%V` command does but it's not opening in the targeted
folder as yet.
The output is a little ugly at rpesent.
In an effort to speed up the prompt we will only call write-vcsstatus if
there is a .git folder in the current or any parent path recursively.
As this function is called every new prompt line it needs to be as fast as
possible.
Explicitly call `import posh-git` because it doesn't have a module
manifest thus powershell can't autoload it when using a cmdlet.
At present the cmder repo doesn't try to download posh-git so it might be
missing from the users session.
This implements custom logic to detect if we're inside of working tree
and skips os calls if not. This will improve performance of prompt
handling, especially for mercurial prompt.
* Adds package to sources.json
* Merges all cmder's lua modules into one -> cmder.lua to exclude future conflicts
* Adds external modules loading logic
This matches how cmd looks in conemu for cmder and PS seems to add some
padding around command output so I really don't see what the extra new
line is doing.
Saving dat precious vertical space.
This should be faster too as we won't automatically import all functions
to the session. Powershell now knows where to look before declaring they
don't exist.
I made a bad patch with the parameters syntax. I'm making the temp files
go into a subfolder as if the build script stop theres a .tmp that could
be accidentially tracked by source control.
Use a full switch to indicate if we want to go and pull a copy of git
since its huge and if a developer is cloning the repo to work on and needs
to build it they already have git.
I was annoyed at having to use short paths all the time in my aliases. It wasn't until I found a command that actually refused to work with a shortpath (running iisexpress.exe) I was determined to find a solution.
It appears that the reason the quoted paths weren't working was due to the ::validate alias stuff. The for command would stumble on a quoted path, arguing that /foo was unexpected...
The additions on lines 7-8 wrap the input in quotes and then strip the inner quotes. This variable is used in the for loop (instead of %*) for validating the alias. So long as the alias is valid (contains no spaces) then the existing method of appending the new alias to the aliases file works just fine because it still uses %*.
Copy of the https://github.com/bliker/cmder/pull/320
Now for the development branch.
Disable ugly grey windows borders. Especially beautiful for the Quake mode.
Add bin/unalias.bat to perform the opposite action of alias.bat.
Removes a given alias from the current shell environment and the
aliases file.
Fixes issue #281.
When launching a cmd in admin mode, if %ConEmuDir%\..\.. contains any space, it breaks the scripts.
Thanks to this patch, the path is correctly defined now.
When starting a shell as Administrator, the CMDER_ROOT variable is
not propagated from the parent (non-Admin) environment.
Fix this by using paths relative to %ConEmuDir%.
Fixes issue #94.
Existing code registered right-click only for blank areas of the
Explorer window. This change adds a menu item for right-clicking on a
folder in the file list.
Also adds the program's icon to help find it in a crowded context menu.
working script will;
Remove existing folders named in the sources
Download the packages listed in sources.json
Extracts the above packages
deletes the downloaded package
If there isn't an existing issue, you may open a new one there.
(We don't resolve issues regarding ConEmu here, so, please make sure you open the issue in the correct place.)
more info:https://conemu.github.io/en/ThirdPartyProblems.html
- If you are having an issue with any of the **upstream technologies** that are used by Cmder, please make sure that the issue is reproducible _only_ when used in combination with Cmder.
We may not directly address the issues related to the following tools:
- **[Clink](https://github.com/chrisant996/clink)**,the default shell in Cmder
- **[Git/MinGW](https://github.com/git-for-windows/git)**,which also provide *NIX tools (such as `ls`, `mv`, `cp`, etc)
- **[clink-completions](https://github.com/vladimir-kotikov/clink-completions)**,which provides autocompletion for clink
We'll try our best to help you -- but we recommend creating an issue specifically at each of the corresponding repositories for the best result.
**👉Note:** Try to reproduce the bug you're reporting, on a stand-alone edition of each tool, without using Cmder. If the bug applies when the mentioned tools are NOT used within Cmder, there's a good chance that you should open the bug at the corresponding repo instead.
- Lastly, have a look at the official documentation for Cmder over our website, and our wiki.
Read more about Cmder on ConEmu docs:
https://conemu.github.io/en/cmder.html
#### Prerequisites before submitting an issue
- We do not support any versions older than the current release series, if you are using an older Cmder please update to the latest version first.
- Verify that the issue is not already fixed and is reproducible in the **[latest official Cmder version](https://github.com/cmderdev/cmder/releases).**
- Check the **[current issues list](https://github.com/cmderdev/cmder/issues?q=is%3Aissue)** and perform a **search of the issue tracker (including closed ones)** to avoid posting a duplicate bug report.
- Make sure this is not a support request or question, both of which are better suited for either the **[discussions section](https://github.com/cmderdev/cmder/discussions)**, or the **[questions section](https://github.com/cmderdev/cmder/issues/new?template=question.yml)**.
- Verify that the **[wiki](https://github.com/cmderdev/cmder/wiki)** did not contain a suitable solution either.
Thank you for making sure you are opening a new valid issue! ♥
- type:textarea
id:description
attributes:
label:Description of the issue
description:Provide a clear and concise description of the problem here. Explain the actual behavior vs the expected behavior.
validations:
required:true
- type:textarea
id:reproduction
attributes:
label:How to reproduce
description:Please provide reliable steps to reproduce the problem.
placeholder:|
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required:false
- type:textarea
id:notes
attributes:
label:Additional context
description:Add screenshots, etc. (Anything that will provide more context about the problem)
validations:
required:false
- type:checkboxes
id:checklist
attributes:
label:Checklist
description:Please check all boxes that apply
options:
- label:I have read the documentation.
required:true
- label:I have searched for similar issues and found none that describe my issue.
required:true
- label:I have reproduced the issue on the latest version of Cmder.
required:true
- label:I am certain my issues are not related to ConEmu, Clink, or other third-party tools that Cmder uses.
required:true
- type:markdown
attributes:
value:|
### Some tips on how to write a good bug report with the required information.
- Make sure the description is worded well enough to be understood, and with as much context and examples as possible.
- Post a screenshot or the command that triggered the problem, if applicable.
- Use the *Preview* tab to see how your issue will actually look like, before sending it.
⚠ If for some reason you can not see the text you just wrote, make sure you've read the instructions clearly
- Avoid using ambiguous phrases like:doesn't work, there's a problem, etc.
Help us reproduce the issue by explaining what went wrong, and what did you expect to happen.
- Please keep the ticket language to English only here.
We can't process your issue if it's written in Russian or Chinese as we can't understand them.
- You can find the version of Cmder.exe and ConEmu.exe binaries using Right Click → Properties → Details menu.
- Put an `x` into all the boxes `[ ]` relevant to your issue (correct example: `[x]` -- not like this:`[ x]` or `[x ]`).
- Any text that is between the comment tags will get ignored, e.g.:`<!-- this will NOT work -- >`
You need to write your text either outside the tags, or the line below it.
- ⚠ Read the following page to avoid posting a bad issue:https://conemu.github.io/en/BadIssue.html
Failure to follow these guidelines may result in your issue getting closed. So please follow it carefully!
- If you are opening the feature request regarding any of the **upstream technologies** that are used by Cmder, please open the feature request at the corresponding upstream repos instead:
- **[Clink](https://github.com/chrisant996/clink)**,the default shell in Cmder
- **[Git/MinGW](https://github.com/git-for-windows/git)**,which also provide *NIX tools (such as `ls`, `mv`, `cp`, etc)
- **[clink-completions](https://github.com/vladimir-kotikov/clink-completions)**,which provides autocompletion for clink
- If you would like to ask for guides on how to integrate Cmder with your favorite IDE of choice, or how to perform a specific task with Cmder, make sure you visit our label section first.
You may already have an answer under the Guides or Questions section.
For a list of labels, visit **[🌐 Labels](https://github.com/cmderdev/cmder/labels)**.
(Be sure to also check “Closed” issues in the labels section!)
- If you have a request to provide auto-complete support for a new tool, please post your request here instead:
(What you may be asking here could already be explained there!)
- If you would like to ask for guides on how to integrate Cmder with your favorite IDE of choice, or how to perform a specific task with Cmder, make sure you visit our label section first.
You may already have an answer under the [💬 Guides](https://github.com/cmderdev/cmder/issues?q=label%3A%22%F0%9F%92%AC+Type%3A+Guide%22), [📖 Documentation](https://github.com/cmderdev/cmder/issues?q=label%3A%22%F0%9F%93%96+Documentation%22) or [❔ Questions](https://github.com/cmderdev/cmder/issues?q=is%3Aissue+label%3A%22%E2%9D%94+Type%3A+Question%22) section.
For a list of labels, visit **[Labels](https://github.com/cmderdev/cmder/labels)**.
(Be sure to also check “Closed” issues in the labels section!)
- type:textarea
id:description
attributes:
label:Question
description:What would you to ask about Cmder?
validations:
required:true
- type:checkboxes
id:checklist
attributes:
label:Checklist
description:Please check all boxes that apply
options:
- label:I have read the documentation and made sure what I'm looking for isn't present, or is unclear.
required:true
- label:I have searched for similar issues, and either this question wasn't asked before, or I didn't find any that describe my question.
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name:Checkout repository
uses:actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name:Initialize CodeQL
uses:github/codeql-action/init@v3
with:
languages:${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
Unfortunately we all can't work on Cmder every day of the year, so I have decided to write some guidelines for contributing.
If you follow them your contribution will likely be pulled in quicker.
## Getting Started
* Fork the repository on GitHub (It's that easy)
* Create a feature branch based on the `master` branch.
## Making Changes
* Make changes in your separate branch.
* Check for unnecessary whitespace with `git diff --check` before committing.
* Make sure your commit messages are easy to understand
* Squash your 'Correcting mistakes' commits if you have a lot of them. (See the 'Squashing Commits' link below)
* Make sure your changes won't affect new users or user without a customised system, try out your changes on a fresh Windows VM to see if it would affect a new user's experience.
* Sometimes a change that helps you with your cmder experience and tools doesn't always mean other people may need/want it.
## Making Trivial Changes
### Documentation
* If the documentation is about a currently available feature in cmder or correcting already created documentation, you can safely make your changes on the master branch and pull request them onto master.
## Submitting Changes
* Push your changes to the branch in your fork of the repository.
* Submit a pull request to the develop branch of the cmder repository (unless it's a change in documentation [see above]).
* Make sure you explicitly say to not complete the pull request if you are still making changes.
[](https://gitter.im/cmderdev/cmder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://ci.appveyor.com/project/cmderdev/cmder) [](https://github.com/cmderdev/cmder/actions/workflows/build.yml)
Cmder is a **software package** created out of pure frustration over absence of usable console emulator on Windows. It is based on [ConEmu](https://conemu.github.io/) with *major* config overhaul, comes with a Monokai color scheme, amazing [clink](https://chrisant996.github.io/clink/) (further enhanced by [clink-completions](https://github.com/vladimir-kotikov/clink-completions)) and a custom prompt layout.
The main advantage of Cmder is portability. It is designed to be totally self-contained with no external dependencies, which makes it great for **USB Sticks** or **cloud storage**. So you can carry your console, aliases and binaries (like `wget`, `curl` and `git`) with you anywhere.
The Cmder's user interface is also designed to be more eye pleasing, and you can compare the main differences between Cmder and ConEmu [here](https://conemu.github.io/en/cmder.html).
## Installation
### Single User Portable Config
1. Download the [latest release](https://github.com/cmderdev/cmder/releases/)
2. Extract the archive. *Note: This path should not be `C:\Program Files` or anywhere else that would require Administrator access for modifying configuration files*
3. (optional) Place your own executable files into the `%cmder_root%\bin` folder to be injected into your PATH.
4. Run `Cmder.exe`
### Shared Cmder install with Non-Portable Individual User Config
1. Download the [latest release](https://github.com/cmderdev/cmder/releases/)
2. Extract the archive to a shared location.
3. (optional) Place your own executable files and custom app folders into the `%cmder_root%\bin`. See: [bin/README.md](./bin/Readme.md)
- This folder to be injected into your PATH by default.
- See `/max_depth [1-5]` in 'Command Line Arguments for `init.bat`' table to add subdirectories recursively.
4. (optional) Place your own custom app folders into the `%cmder_root%\opt`. See: [opt/README.md](./opt/Readme.md)
- This folder will NOT be injected into your PATH so you have total control of what gets added.
5. Run `Cmder.exe` with `/C` command line argument. Example: `cmder.exe /C %userprofile%\cmder_config`
* This will create the following directory structure if it is missing.
```
c:\users\[username]\cmder_config
├───bin
├───config
│ └───profile.d
└───opt
```
- (optional) Place your own executable files and custom app folders into `%userprofile%\cmder_config\bin`.
- This folder to be injected into your PATH by default.
- See `/max_depth [1-5]` in 'Command Line Arguments for `init.bat`' table to add subdirectories recursively.
- (optional) Place your own custom app folders into the `%user_profile%\cmder_config\opt`.
- This folder will NOT be injected into your PATH so you have total control of what gets added.
* Both the shared install and the individual user config locations can contain a full set of init and profile.d scripts enabling shared config with user overrides. See below.
* <kbd>Ctrl</kbd> + <kbd>#Number</kbd> : Switch to tab #Number
* <kbd>Alt</kbd> + <kbd>Enter</kbd>: Fullscreen
### Shell
* <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>U</kbd> : Traverse up in directory structure (lovely feature!)
* <kbd>End</kbd>, <kbd>Home</kbd>, <kbd>Ctrl</kbd> : Traversing text with as usual on Windows
* <kbd>Ctrl</kbd> + <kbd>R</kbd> : History search
* <kbd>Shift</kbd> + Mouse : Select and copy text from buffer
_(Some shortcuts are not yet documented, though they exist - please document them here)_
## Features
### Access to multiple shells in one window using tabs
You can open multiple tabs each containing one of the following shells:
| Task | Shell | Description |
| ---- | ----- | ----------- |
| Cmder | `cmd.exe` | Windows `cmd.exe` shell enhanced with Git, Git aware prompt, Clink (GNU Readline), and Aliases. |
| Cmder as Admin | `cmd.exe` | Administrative Windows `cmd.exe` Cmder shell. |
| PowerShell | `powershell.exe` | Windows PowerShell enhanced with Git and Git aware prompt . |
| PowerShell as Admin | `powershell.exe` | Administrative Windows `powershell.exe` Cmder shell. |
| Bash | `bash.exe` | Unix/Linux like bash shell running on Windows. |
| Bash as Admin | `bash.exe` | Administrative Unix/Linux like bash shell running on Windows. |
| Mintty | `bash.exe` | Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences |
| Mintty as Admin | `bash.exe` | Administrative Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences |
Cmder, PowerShell, and Bash tabs all run on top of the Windows Console API and work as you might expect in Cmder with access to use ConEmu's color schemes, key bindings and other settings defined in the ConEmu Settings dialog.
⚠ *Note:* Only the full edition of Cmder comes with a pre-installed bash, using a vendored [git-for-windows](https://gitforwindows.org/) installation. The pre-configured Bash tabs may not work on Cmder mini edition without additional configuration.
You may however, choose to use an external installation of bash, such as Microsoft's [Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) (called WSL) or the [Cygwin](https://cygwin.com/) project which provides POSIX support on windows.
⚠ *Note:* Mintty tabs use a program called 'mintty' as the terminal emulator that is not based on the Windows Console API, rather it's rendered graphically by ConEmu. Mintty differs from the other tabs in that it supports xterm/xterm-256color TERM types, and does not work with ConEmu settings like color schemes and key bindings. As such, some differences in functionality are to be expected, such as Cmder not being able to apply a system-wide configuration to it.
As a result mintty specific config is done via the `[%USERPROFILE%|$HOME]/.minttyrc` file. You may read more about Mintty and its config file [here](https://github.com/mintty/mintty).
An example of setting Cmder portable terminal colors for mintty:
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).
The default Cmder shell `cmd::Cmder` prompt 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`
| `/c [user cmder root]` | Enables user bin and config folders for 'Cmder as admin' sessions due to non-shared environment. | not set |
| `/d` | Enables debug output. | not set |
| `/f` | Enables Cmder Fast Init Mode. This disables some features, see pull request [#1492](https://github.com/cmderdev/cmder/pull/1942) for more details. | not set |
| `/t` | Enables Cmder Timed Init Mode. This displays the time taken run init scripts | not set |
| `/home [home folder]` | User specified folder path to set `%HOME%` environment variable. | `%userprofile%` |
| `/max_depth [1-5]` | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 1 |
| `/nix_tools [0-2]` | Define how `*nix` tools are added to the path. Prefer Windows Tools: 1, Prefer *nix Tools: 2, No `/usr/bin` in `%PATH%`: 0 | 1 |
| `/svn_ssh [path to ssh.exe]` | Define `%SVN_SSH%` so we can use git svn with ssh svn repositories. | `%GIT_INSTALL_ROOT%\bin\ssh.exe` |
| `/user_aliases [file path]` | File path pointing to user aliases. | `%CMDER_ROOT%\config\user_aliases.cmd` |
| `/v` | Enables verbose output. | not set |
| (custom arguments) | User defined arguments processed by `cexec`. Type `cexec /?` for more usage. | not set |
### Cmder Shell User Config
Single user portable configuration is possible using the Cmder specific shell config files. Edit the below files to add your own configuration:
**Note:** Bash and Mintty sessions will also source the `$HOME/.bashrc` file if it exists after it sources `$CMDER_ROOT/config/user_profile.sh`.
You can write `*.cmd|*.bat`, `*.ps1`, and `*.sh` scripts and just drop them in the `%CMDER_ROOT%\config\profile.d` folder to add startup config to Cmder.
To disable Cmder prompt git status globally add the following to `~/.gitconfig` or locally for a single repo `[repo]/.git/config` and start a new session.
*Note: This configuration is not portable*
```
[cmder]
status = false # Opt out of Git status for 'ALL' Cmder supported shells.
cmdstatus = false # Opt out of Git status for 'Cmd.exe' shells.
psstatus = false # Opt out of Git status for 'Powershell.exe and 'Pwsh.exe' shells.
shstatus = false # Opt out of Git status for 'bash.exe' shells.
```
### Aliases
#### Cmder(`Cmd.exe`) Aliases
You can define simple aliases for `cmd.exe` sessions with a command like `alias name=command`. Cmd.exe aliases support optional parameters through the `$1-9` or the `$*` special characters so the alias `vi=vim.exe $*` typed as `vi [filename]` will open `[filename]` in `vim.exe`.
Cmd.exe aliases can also be more complex. See: [DOSKEY.EXE documentation](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/doskey) for additional details on complex aliases/macros for `cmd.exe`
Aliases defined using the `alias.bat` command will automatically be saved in the `%CMDER_ROOT%\config\user_aliases.cmd` file
To make an alias and/or any other profile settings permanent add it to one of the following:
Note: These are loaded in this order by `$CMDER_ROOT/vendor/init.bat`. Anything stored in `%CMDER_ROOT%` will be a portable setting and will follow Cmder to another machine.
* `%CMDER_ROOT%\config\profile.d\*.cmd` and `\*.bat`
* `%CMDER_ROOT%\config\user_aliases.cmd`
* `%CMDER_ROOT%\config\user_profile.cmd`
#### Bash.exe|Mintty.exe Aliases
Bash shells support simple and complex aliases with optional parameters natively so they work a little different. Typing `alias name=command` will create an alias only for the current running session.
To make an alias and/or any other profile settings permanent add it to one of the following:
Note: These are loaded in this order by `$CMDER_ROOT/vendor/git-for-windows/etc/profile.d/cmder.sh`. Anything stored in `$CMDER_ROOT` will be a portable setting and will follow Cmder to another machine.
* `$CMDER_ROOT/config/profile.d/*.sh`
* `$CMDER_ROOT/config/user_profile.sh`
* `$HOME/.bashrc`
If you add bash aliases to `$CMDER_ROOT/config/user_profile.sh` they will be portable and follow your Cmder folder if you copy it to another machine. `$HOME/.bashrc` defined aliases are not portable.
#### PowerShell.exe Aliases
PowerShell has native simple alias support, for example `[new-alias | set-alias] alias command`, so complex aliases with optional parameters are not supported in PowerShell sessions. Type `get-help [new-alias|set-alias] -full` for help on PowerShell aliases.
To make an alias and/or any other profile settings permanent add it to one of the following:
Note: These are loaded in this order by `$ENV:CMDER_ROOT\vendor\user_profile.ps1`. Anything stored in `$ENV:CMDER_ROOT` will be a portable setting and will follow Cmder to another machine.
* `$ENV:CMDER_ROOT\config\profile.d\*.ps1`
* `$ENV:CMDER_ROOT\config\user_profile.ps1`
### SSH Agent
To start the vendored SSH agent simply call `start-ssh-agent`, which is in the `vendor/git-for-windows/cmd` folder.
If you want to run SSH agent on startup, include the line `@call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"` in `%CMDER_ROOT%/config/user_profile.cmd` (usually just uncomment it).
### Vendored Git
Cmder is by default shipped with a vendored Git installation. On each instance of launching Cmder, an attempt is made to locate any other user provided Git binaries. Upon finding a `git.exe` binary, Cmder further compares its version against the vendored one _by executing_ it. The vendored `git.exe` binary is _only_ used when it is more recent than the user-installed one.
You may use your favorite version of Git by including its path in the `%PATH%` environment variable. Moreover, the **Mini** edition of Cmder (found on the [downloads page](https://github.com/cmderdev/cmder/releases)) excludes any vendored Git binaries.
### Using external Cygwin/Babun, MSys2, WSL, or Git for Windows SDK with Cmder.
You may run bash (the default shell used on Linux, macOS and GNU/Hurd) externally on Cmder, using the following instructions:
1. Setup a new task by pressing <kbd>Win</kbd> +<kbd>Alt</kbd> + <kbd>T</kbd>.
1. Click the `+` button to add a task.
1. Name the new task in the top text box.
1. Provide task parameters, this is optional.
1. Add `cmd /c "[path_to_external_env]\bin\bash --login -i" -new_console` to the `Commands` text box.
**Recommended Optional Steps:**
Copy the `vendor/cmder_exinit` file to the Cygwin/Babun, MSys2, or Git for Windows SDK environments `/etc/profile.d/` folder to use portable settings in the `$CMDER_ROOT/config` folder.
Note: MinGW could work if the init scripts include `profile.d` but this has not been tested.
The destination file extension depends on the shell you use in that environment. For example:
* bash - Copy to `/etc/profile.d/cmder_exinit.sh`
* zsh - Copy to `/etc/profile.d/cmder_exinit.zsh`
Uncomment and edit the line below in the script to use Cmder config even when launched from outside Cmder.
```
# CMDER_ROOT=${USERPROFILE}/cmder # This is not required if launched from Cmder.
```
### Customizing user sessions using `init.bat` custom arguments.
You can pass custom arguments to `init.bat` and use `cexec.cmd` in your `user_profile.cmd` to evaluate these
arguments then execute commands based on a particular flag being detected or not.
`init.bat` creates two shortcuts for using `cexec.cmd` in your profile scripts.
#### `%ccall%` - Evaluates flags, runs commands if found, and returns to the calling script and continues.
* Add the below to your `%cmder_root%\config\user_profile.cmd`
```batch
%ccall% "/startNotepad" "start" "notepad.exe"`
```
To see detailed usage of `cexec`, type `cexec /?` in Cmder.
### Integrating Cmder with [Windows Terminal](https://github.com/cmderdev/cmder/wiki/Seamless-Windows-Terminal-Integration), [VS Code](https://github.com/cmderdev/cmder/wiki/Seamless-VS-Code-Integration), and your favorite IDEs
Cmder by default comes with a vendored ConEmu installation as the underlying terminal emulator, as stated [here](https://conemu.github.io/en/cmder.html).
However, Cmder can in fact run in a variety of other terminal emulators, and even integrated IDEs. Assuming you have the latest version of Cmder, follow the following instructions to get Cmder working with your own terminal emulator.
For instructions on how to integrate Cmder with your IDE, please read our [Wiki section](https://github.com/cmderdev/cmder/wiki#cmder-integration).
## Upgrading
The process of upgrading Cmder depends on the version/build you are currently running.
If you have a `[cmder_root]/config/user[-|_]conemu.xml`, you are running a newer version of Cmder, follow the below process:
1. Exit all Cmder sessions and relaunch `[cmder_root]/cmder.exe`, this backs up your existing `[cmder_root]/vendor/conemu-maximus5/conemu.xml` to `[cmder_root]/config/user[-|_]conemu.xml`.
* The `[cmder_root]/config/user[-|_]conemu.xml` contains any custom settings you have made using the 'Setup Tasks' settings dialog.
2. Exit all Cmder sessions and backup any files you have manually edited under `[cmder_root]/vendor`.
* Editing files under `[cmder_root]/vendor` is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in `[cmder_root]/config` folder.
3. Delete the `[cmder_root]/vendor` folder.
4. Extract the new `cmder.zip` or `cmder_mini.zip` into `[cmder_root]/` overwriting all files when prompted.
If you do not have a `[cmder_root]/config/user[-|_]conemu.xml`, you are running an older version of cmder, follow the below process:
1. Exit all Cmder sessions and backup `[cmder_root]/vendor/conemu-maximus5/conemu.xml` to `[cmder_root]/config/user[-|_]conemu.xml`.
2. Backup any files you have manually edited under `[cmder_root]/vendor`.
* Editing files under `[cmder_root]/vendor` is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in `[cmder_root]/config` folder.
3. Delete the `[cmder_root]/vendor` folder.
4. Extract the new `cmder.zip` or `cmder_mini.zip` into `[cmder_root]/` overwriting all files when prompted.
## Current development builds
You can download builds of the current development branch by going to AppVeyor via the following link:
Latest release is **[v1.1.3](https://github.com/bliker/cmder/releases/tag/v1.1.3)**
Cmder is a **software package** created out of pure frustration over absence of usable console emulator on Windows. It is based on [ConEmu](https://code.google.com/p/conemu-maximus5/) with *major* config overhaul. Monokai color scheme, amazing [clink](https://code.google.com/p/clink/) and custom prompt layout.
The main advantage of Cmder is portability. It is designed to be totally self-contained with no external dependencies, that is makes it great for **USB Sticks** or **Dropbox**. So you can carry your console, aliases and binaries (like wget, curl and git) with you anywhere.
## Installation
1. Download the latest release
1. Extract
1. (optional) Place files into `bin` folder, it will be injected into your PATH.
1. Run cmder
*(There will be a version with installer)*
## Keyboard shortcuts
### Tab manipulation
* `Ctrl + t` : new tab dialog (maybe you want to open cmd as admin?)
* `Ctrl + w` : close tab
* `Ctrl + d` : close tab (if pressed on empty command)
* `Shift + alt + number` : fast new tab: `1` - CMD, `2` - Powershell `*` - More to come
* `Alt + enter`: Fullscreen
### Shell
* `Shift + Up` : Traverse up in directory structure (lovely feature!)
* `End, Home, Ctrl` : Traversing text with as usual on Windows
* `Ctrl + r` : History search
* `Shift + mouse` : Select and copy text from buffer
(Some shortcuts are not yet documented, thought they exist, please add them here)
## Features
### Aliases
You can define simple aliases with command `alias name=command`.
For example there is one defined for you `alias e.=explorer .`
All aliases will be saved in `/config/aliases` file
## Todo
1. Complete PowerShell compatibility.
2. Workaround git.exe overload after msysgit download (Granted this is an upstream issue).
3. Redo Build/Pack scripts or remove them altogether.
4. Launcher XP compatibility.
## License
All software included is bundled with own license
The MIT License (MIT)
Copyright (c) 2013 Samuel Vasko
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
If you discover a security issue in our project, please report it to [MartiUK](https://github.com/MartiUK). We will acknowledge your email within 24 hours and provide a more detailed response within 48 hours. We will try to fix the issue as soon as possible and inform you when a new version is released.
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
- The nature of the issue
- The affected source file(s) with full paths
- The location of the vulnerable code (tag/branch/commit or direct URL)
- Any special configuration needed to reproduce the issue
- Detailed steps to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- The impact of the issue, including how an attacker could exploit it
Please do not disclose the vulnerability publicly until we have resolved it.
if(PathFileExists(cpuCfgPath)||use_user_cfg==false)// config/ConEmu-%COMPUTERNAME%.xml file exists or /m was specified on command line, use machine specific config.
{
if(cfgRoot.length()==0)// '/c [path]' was NOT specified
{
if(PathFileExists(cfgPath))// vendor/conemu-maximus5/ConEmu.xml file exists, copy vendor/conemu-maximus5/ConEmu.xml to config/ConEmu-%COMPUTERNAME%.xml.
{
if(!CopyFile(cfgPath,cpuCfgPath,FALSE))
{
MessageBox(NULL,
(GetLastError()==ERROR_ACCESS_DENIED)
?L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
:L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!",MB_TITLE,MB_ICONSTOP);
exit(1);
}
}
else// vendor/conemu-maximus5/ConEmu.xml config file does not exist, copy config/ConEmu-%COMPUTERNAME%.xml to vendor/conemu-maximus5/ConEmu.xml file
{
if(!CopyFile(cpuCfgPath,cfgPath,FALSE))
{
MessageBox(NULL,
(GetLastError()==ERROR_ACCESS_DENIED)
?L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
:L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!",MB_TITLE,MB_ICONSTOP);
exit(1);
}
}
}
else// '/c [path]' was specified, don't copy anything and use existing conemu-%COMPUTERNAME%.xml to start comemu.
{
if(use_user_cfg==false&&PathFileExists(cfgPath)&&!PathFileExists(cpuCfgPath))// vendor/conemu-maximus5/ConEmu.xml file exists, copy vendor/conemu-maximus5/ConEmu.xml to config/ConEmu-%COMPUTERNAME%.xml.
{
if(!CopyFile(cfgPath,cpuCfgPath,FALSE))
{
MessageBox(NULL,
(GetLastError()==ERROR_ACCESS_DENIED)
?L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
:L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!",MB_TITLE,MB_ICONSTOP);
This folder is for optional user packages and will not be automatically injected into the PATH.
Use `%lib_path% enhance_path "%cmder_root%\[path to folder]"` in `%cmder_root%\config\user_profile.cmd` or `%cmder_root%\config\profile.d\*.cmd` to add to the path.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.