mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-14 07:29:12 +08:00
Merge remote-tracking branch 'origin' into user_lua
This commit is contained in:
commit
e93231114f
27
.github/issue_template.md
vendored
27
.github/issue_template.md
vendored
@ -4,7 +4,7 @@
|
|||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
|
||||||
Please make sure you read and follow the following instructions
|
Please make sure you read and follow the following instructions
|
||||||
before reporting bugs, and/or requesting new features.
|
carefully before reporting bugs, and/or requesting new features.
|
||||||
|
|
||||||
Make sure that you have:
|
Make sure that you have:
|
||||||
|
|
||||||
@ -24,17 +24,22 @@
|
|||||||
|
|
||||||
https://github.com/Maximus5/ConEmu/issues?q=is:issue
|
https://github.com/Maximus5/ConEmu/issues?q=is:issue
|
||||||
|
|
||||||
If there isn't an existing issue, you may open a new one.
|
If there isn't an existing issue, you may open a new one there.
|
||||||
|
|
||||||
(We don't resolve issues regarding ConEmu here, so please
|
(We don't resolve issues regarding ConEmu here, so please
|
||||||
make sure you open the issue in the correct place.)
|
make sure you open the issue in the correct place.)
|
||||||
|
|
||||||
• If you are asking for Guides on how to integrate Cmder into
|
more info: https://conemu.github.io/en/ThirdPartyProblems.html
|
||||||
your favorite IDE of choice, or how to perform an specific
|
|
||||||
task with Cmder, make sure you visit our Guides section first:
|
|
||||||
|
|
||||||
- https://github.com/cmderdev/cmder/issues?q=label:Guide
|
• If you are asking for guides on how to integrate Cmder into
|
||||||
- https://github.com/cmderdev/cmder/issues?q=label:Question
|
your favorite IDE of choice, or how to perform an 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:
|
||||||
|
- https://github.com/cmderdev/cmder/labels
|
||||||
|
|
||||||
|
(Be sure to also check “Closed” issues in the labels section!)
|
||||||
|
|
||||||
• If the issue is regarding the other upstream technologies that
|
• If the issue is regarding the other upstream technologies that
|
||||||
Cmder uses (e.g. Clink, Git, etc), please make sure that the
|
Cmder uses (e.g. Clink, Git, etc), please make sure that the
|
||||||
@ -43,6 +48,9 @@
|
|||||||
tools are NOT used within Cmder, there's a good chance that
|
tools are NOT used within Cmder, there's a good chance that
|
||||||
you should open the bug at the corresponding repo instead.
|
you should open the bug at the corresponding repo instead.
|
||||||
|
|
||||||
|
Read more on about Cmder on ConEmu docs:
|
||||||
|
https://conemu.github.io/en/cmder.html
|
||||||
|
|
||||||
|
|
||||||
Thank you for making sure you are opening a new valid issue!
|
Thank you for making sure you are opening a new valid issue!
|
||||||
|
|
||||||
@ -56,6 +64,9 @@
|
|||||||
- Post a screenshot or the command the triggered the problem, if applicable.
|
- Post a screenshot or the command the triggered the problem, if applicable.
|
||||||
- Avoid using ambiguous phrases like: doesn't work, there'a problem, etc.
|
- Avoid using ambiguous phrases like: doesn't work, there'a problem, etc.
|
||||||
Help us reproduce the issue by explaining what went wrong, and what did you expect to happen.
|
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.
|
||||||
|
- ⚠ Read the following page to avoid posting a bad issue: https://conemu.github.io/en/BadIssue.html
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Purpose of the issue
|
### Purpose of the issue
|
||||||
@ -64,4 +75,4 @@
|
|||||||
- [ ] Question
|
- [ ] Question
|
||||||
|
|
||||||
### Description of the issue
|
### Description of the issue
|
||||||
|
<!-- Provide a clear, simple description of your issue here -->
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -14,9 +14,11 @@ build/
|
|||||||
Version v*
|
Version v*
|
||||||
*.bak
|
*.bak
|
||||||
config/user-*
|
config/user-*
|
||||||
|
config/user_*
|
||||||
config/*.lua
|
config/*.lua
|
||||||
config/settings
|
config/settings
|
||||||
config/aliases
|
config/aliases
|
||||||
config/profile.d
|
config/profile.d
|
||||||
.github_changelog_generator
|
.github_changelog_generator
|
||||||
launcher/.vs
|
launcher/.vs
|
||||||
|
launcher/src/version.rc2
|
||||||
|
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,5 +1,16 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [1.3.6](https://github.com/cmderdev/cmder/tree/v1.3.6) (2018-05-30)
|
||||||
|
**Updated components:**
|
||||||
|
|
||||||
|
* Git updated to v2.17.1.windows.2
|
||||||
|
* ConEmu updated to 180528
|
||||||
|
|
||||||
|
**Updates:**
|
||||||
|
|
||||||
|
* Cmder now opens in the in the current working dir
|
||||||
|
* TBD
|
||||||
|
|
||||||
## [1.3.6-pre2](https://github.com/cmderdev/cmder/tree/v1.3.6-pre2) (2018-03-01)
|
## [1.3.6-pre2](https://github.com/cmderdev/cmder/tree/v1.3.6-pre2) (2018-03-01)
|
||||||
|
|
||||||
**Updated components:**
|
**Updated components:**
|
||||||
|
139
README.md
139
README.md
@ -10,13 +10,15 @@ Cmder is a **software package** created out of pure frustration over absence of
|
|||||||
|
|
||||||
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 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
|
## Installation
|
||||||
### Single User Portable Config
|
### Single User Portable Config
|
||||||
|
|
||||||
1. Download the [latest release](https://github.com/cmderdev/cmder/releases/)
|
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*
|
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.
|
3. (optional) Place your own executable files into the `%cmder_root%\bin` folder to be injected into your PATH.
|
||||||
4. Run Cmder.exe
|
4. Run `Cmder.exe`
|
||||||
|
|
||||||
### Shared Cmder install with Non-Portable Individual User Config
|
### Shared Cmder install with Non-Portable Individual User Config
|
||||||
1. Download the [latest release](https://github.com/cmderdev/cmder/releases/)
|
1. Download the [latest release](https://github.com/cmderdev/cmder/releases/)
|
||||||
@ -24,7 +26,7 @@ The main advantage of Cmder is portability. It is designed to be totally self-co
|
|||||||
3. (optional) Place your own executable files into the `%cmder_root%\bin` folder to be injected into your PATH.
|
3. (optional) Place your own executable files into the `%cmder_root%\bin` folder to be injected into your PATH.
|
||||||
4. (optional) Create `%userprofile%\cmder_config\bin` folder to be injected into individual users PATH. Default is to auto create this on first run.
|
4. (optional) Create `%userprofile%\cmder_config\bin` folder to be injected into individual users PATH. Default is to auto create this on first run.
|
||||||
5. (optional) Place your own executable files into the `%userprofile%\cmder_config\bin` folder to be injected into your PATH.
|
5. (optional) Place your own executable files into the `%userprofile%\cmder_config\bin` folder to be injected into your PATH.
|
||||||
6. Run Cmder.exe with "/C" command line argument. Example: `cmder.exe /C %userprofile%\cmder_config`
|
6. 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.
|
* This will create the following directory structure if it is missing.
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -41,10 +43,10 @@ The main advantage of Cmder is portability. It is designed to be totally self-co
|
|||||||
|
|
||||||
| Argument | Description |
|
| Argument | Description |
|
||||||
| ------------------- | ----------------------------------------------------------------------- |
|
| ------------------- | ----------------------------------------------------------------------- |
|
||||||
| /C [user_root_path] | Individual user Cmder root folder. Example: %userprofile%\cmder_config |
|
| `/C [user_root_path]` | Individual user Cmder root folder. Example: `%userprofile%\cmder_config` |
|
||||||
| /SINGLE | Start Cmder is single mode. |
|
| `/SINGLE` | Start Cmder is single mode. |
|
||||||
| /START [start_path] | Folder path to start in. |
|
| `/START [start_path]` | Folder path to start in. |
|
||||||
| /TASK [task_name] | Task to start after launch. |
|
| `/TASK [task_name]` | Task to start after launch. |
|
||||||
|
|
||||||
## Context Menu Integration
|
## Context Menu Integration
|
||||||
|
|
||||||
@ -79,7 +81,7 @@ In a file explorer window right click in or on a directory to see "Cmder Here" i
|
|||||||
* <kbd>Ctrl</kbd> + <kbd>R</kbd> : History search
|
* <kbd>Ctrl</kbd> + <kbd>R</kbd> : History search
|
||||||
* <kbd>Shift</kbd> + Mouse : Select and copy text from buffer
|
* <kbd>Shift</kbd> + Mouse : Select and copy text from buffer
|
||||||
|
|
||||||
(Some shortcuts are not yet documented, though they exist - please document them here)
|
_(Some shortcuts are not yet documented, though they exist - please document them here)_
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@ -88,20 +90,24 @@ You can open multiple tabs each containing one of the following shells:
|
|||||||
|
|
||||||
| Task | Shell | Description |
|
| Task | Shell | Description |
|
||||||
| ---- | ----- | ----------- |
|
| ---- | ----- | ----------- |
|
||||||
| Cmder | cmd.exe | Windows 'cmd.exe' shell enhanced with Git, Git aware prompt, Clink(GNU Readline), and Aliases. |
|
| 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. |
|
| Cmder as Admin | `cmd.exe` | Administrative Windows 'cmd.exe' Cmder shell. |
|
||||||
| PowerShell | powershell.exe | Windows PowerShell enhanced with Git and Git aware prompt . |
|
| PowerShell | `powershell.exe` | Windows PowerShell enhanced with Git and Git aware prompt . |
|
||||||
| PowerShell as Admin | powershell.exe | Administrative Windows 'powershell.exe' Cmder shell. |
|
| PowerShell as Admin | `powershell.exe` | Administrative Windows `powershell.exe` Cmder shell. |
|
||||||
| Bash | bash.exe | Unix/Linux like bash shell running on Windows. |
|
| 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. |
|
| 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 | `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 |
|
| 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.
|
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.
|
||||||
|
|
||||||
Mintty tabs use a program called 'mintty' as the terminal that is not based on the Windows Console API so some differences in functionality are normal, as a result mintty specific config is done via the '[%USERPROFILE%|$HOME]/.minttyrc' file.
|
⚠ *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 eidition without additional configuration.
|
||||||
|
|
||||||
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. For more on Mintty and its config click [here](https://github.com/mintty/mintty).
|
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:
|
An example of setting Cmder portable terminal colors for mintty:
|
||||||
|
|
||||||
@ -111,10 +117,12 @@ From a bash/mintty shell:
|
|||||||
cd $CMDER_ROOT/vendor
|
cd $CMDER_ROOT/vendor
|
||||||
git clone https://github.com/karlin/mintty-colors-solarized.git
|
git clone https://github.com/karlin/mintty-colors-solarized.git
|
||||||
cd mintty-colors-solarized/
|
cd mintty-colors-solarized/
|
||||||
echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh>>$CMDER_ROOT/config/user-profile.sh
|
echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh>>$CMDER_ROOT/config/user_profile.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### Changing Cmder Default 'cmd.exe' Shell Startup Behaviour Using Task Arguments
|
You may find some Monokai color schemes for mintty to match Cmder [here](https://github.com/PhilipDaniels/mintty/blob/master/themes/Monokai) or [here](https://github.com/oumu/mintty-color-schemes/blob/master/base16-monokai-mod.minttyrc).
|
||||||
|
|
||||||
|
### Changing Cmder Default `cmd.exe` Shell Startup Behaviour Using Task Arguments
|
||||||
|
|
||||||
1. Press <kbd>Win</kbd> + <kbd>Alt</kbd> + <kbd>T</kbd>
|
1. Press <kbd>Win</kbd> + <kbd>Alt</kbd> + <kbd>T</kbd>
|
||||||
1. Click either:
|
1. Click either:
|
||||||
@ -132,36 +140,36 @@ echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh
|
|||||||
|
|
||||||
| Argument | Description | Default |
|
| Argument | Description | Default |
|
||||||
| ----------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------- |
|
| ----------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------- |
|
||||||
| /c [user cmder root] | Enables user bin and config folders for 'Cmder as admin' sessions due to non-shared environment. | not set |
|
| `/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 |
|
| `/d` | Enables debug output. | not set |
|
||||||
| /git_install_root [file path] | User specified Git installation root path. | '%CMDER_ROOT%\vendor\Git-for-Windows' |
|
| `/git_install_root [file path]` | User specified Git installation root path. | `%CMDER_ROOT%\vendor\Git-for-Windows` |
|
||||||
| /home [home folder] | User specified folder path to set `%HOME%` environment variable. | '%userprofile%' |
|
| `/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 |
|
| `/max_depth [1-5]` | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 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' |
|
| `/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-liases.cmd' |
|
| `/user_aliases [file path]` | File path pointing to user aliases. | `%CMDER_ROOT%\config\user-liases.cmd` |
|
||||||
| /v | Enables verbose output. | not set |
|
| `/v` | Enables verbose output. | not set |
|
||||||
|
|
||||||
### Cmder Shell User Config
|
### 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:
|
Single user portable configuration is possible using the cmder specific shell config files. Edit the below files to add your own configuration:
|
||||||
|
|
||||||
| Shell | Cmder Portable User Config |
|
| Shell | Cmder Portable User Config |
|
||||||
| ------------- | ----------------------------------------- |
|
| ------------- | ----------------------------------------- |
|
||||||
| Cmder | %CMDER_ROOT%\\config\\user-profile.cmd |
|
| Cmder | `%CMDER_ROOT%\\config\\user_profile.cmd` |
|
||||||
| PowerShell | $ENV:CMDER_ROOT\\config\\user-profile.ps1 |
|
| PowerShell | `$ENV:CMDER_ROOT\\config\\user_profile.ps1` |
|
||||||
| Bash/Mintty | $CMDER_ROOT/config/user-profile.sh |
|
| Bash/Mintty | `$CMDER_ROOT/config/user_profile.sh` |
|
||||||
|
|
||||||
Note: Bash and Mintty sessions will also source the '$HOME/.bashrc' file if it exists after it sources '$CMDER_ROOT/config/user-profile.sh'.
|
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.
|
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.
|
||||||
|
|
||||||
| Shell | Cmder 'Profile.d' Scripts |
|
| Shell | Cmder `Profile.d` Scripts |
|
||||||
| ------------- | --------------------------------------------------|
|
| ------------- | --------------------------------------------------|
|
||||||
| Cmder | %CMDER_ROOT%\\config\\profile.d\\\*.bat and *.cmd |
|
| Cmder | `%CMDER_ROOT%\\config\\profile.d\\\*.bat and *.cmd` |
|
||||||
| PowerShell | $ENV:CMDER_ROOT\\config\\profile.d\\\*.ps1 |
|
| PowerShell | `$ENV:CMDER_ROOT\\config\\profile.d\\\*.ps1` |
|
||||||
| Bash/Mintty | $CMDER_ROOT/config/profile.d/*.sh |
|
| Bash/Mintty | `$CMDER_ROOT/config/profile.d/*.sh` |
|
||||||
|
|
||||||
### Aliases
|
### Aliases
|
||||||
#### Cmder(Cmd.exe) 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`.
|
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](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/doskey.mspx?mfr=true) for additional details on complex aliases/macros for 'cmd.exe'
|
Cmd.exe aliases can also be more complex. See: [DOSKEY.EXE documentation](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/doskey.mspx?mfr=true) for additional details on complex aliases/macros for 'cmd.exe'
|
||||||
@ -170,40 +178,40 @@ Aliases defined using the `alias.bat` command will automatically be saved in the
|
|||||||
|
|
||||||
To make an alias and/or any other profile settings permanent add it to one of the following:
|
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'. Anyhing stored in '%CMDER_ROOT%' will be a portable setting and will follow cmder to another machine.
|
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\\profile.d\\\*.cmd` and `\*.bat`
|
||||||
* '%CMDER_ROOT%\\config\\user-aliases.cmd'
|
* `%CMDER_ROOT%\\config\\user-aliases.cmd`
|
||||||
* '%CMDER_ROOT%\\config\\user-profile.cmd'
|
* `%CMDER_ROOT%\\config\\user_profile.cmd`
|
||||||
|
|
||||||
#### Bash.exe|Mintty.exe Aliases
|
#### 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.
|
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:
|
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'. Anyhing stored in '$CMDER_ROOT' will be a portable setting and will follow cmder to another machine.
|
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/profile.d/*.sh`
|
||||||
* '$CMDER_ROOT/config/user-profile.sh'
|
* `$CMDER_ROOT/config/user_profile.sh`
|
||||||
* '$HOME/.bashrc'
|
* `$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.
|
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.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.
|
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:
|
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'. Anyhing stored in '$ENV:CMDER_ROOT' will be a portable setting and will follow cmder to another machine.
|
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\\profile.d\\\*.ps1'
|
||||||
* '$ENV:CMDER_ROOT\\config\\user-profile.ps1'
|
* '$ENV:CMDER_ROOT\\config\\user_profile.ps1'
|
||||||
|
|
||||||
### SSH Agent
|
### SSH Agent
|
||||||
|
|
||||||
To start the vendored SSH agent simply call `start-ssh-agent`, which is in the `vendor/git-for-windows/cmd` folder.
|
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).
|
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
|
### Vendored Git
|
||||||
|
|
||||||
@ -211,24 +219,26 @@ Cmder is by default shipped with a vendored Git installation. On each instance
|
|||||||
|
|
||||||
You may use your favorite version of Git by including its path in the `%PATH%` enviroment variable. Moreover, the **Mini** edition of Cmder (found on the [downloads page](https://github.com/cmderdev/cmder/releases)) excludes any vendored Git binaries.
|
You may use your favorite version of Git by including its path in the `%PATH%` enviroment 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, or Git for Windows SDK with Cmder.
|
### Using external Cygwin/Babun, MSys2, WSL, or Git for Windows SDK with Cmder.
|
||||||
|
|
||||||
1. Setup a new task by pressing '<kbd>Win</kbd> +<kbd>Alt</kbd> + <kbd>T</kbd>'.
|
You may run bash (the default shell used on Linux, macOS and GNU/Hurd) externally on Cmder, using the following instructions:
|
||||||
1. Click the '+' button to add a task.
|
|
||||||
|
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. Name the new task in the top text box.
|
||||||
1. Provide task parameters, this is optional.
|
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.
|
1. Add `cmd /c "[path_to_external_env]\bin\bash --login -i" -new_console` to the `Commands` text box.
|
||||||
|
|
||||||
Recommended Optional Steps:
|
**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.
|
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.
|
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:
|
The destination file extension depends on the shell you use in that environment. For example:
|
||||||
|
|
||||||
* bash - Copy to /etc/profile.d/cmder_exinit.sh
|
* bash - Copy to `/etc/profile.d/cmder_exinit.sh`
|
||||||
* zsh - Copy to /etc/profile.d/cmder_exinit.zsh
|
* zsh - Copy to `/etc/profile.d/cmder_exinit.zsh`
|
||||||
|
|
||||||
Uncomment and edit the below line in the script to use Cmder config even when launched from outside Cmder.
|
Uncomment and edit the below line in the script to use Cmder config even when launched from outside Cmder.
|
||||||
|
|
||||||
@ -236,9 +246,16 @@ Uncomment and edit the below line in the script to use Cmder config even when la
|
|||||||
# CMDER_ROOT=${USERPROFILE}/cmder # This is not required if launched from Cmder.
|
# CMDER_ROOT=${USERPROFILE}/cmder # This is not required if launched from Cmder.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Integrating Cmder with [Hyper](https://github.com/zeit/hyper), [Microsoft VS Code](https://code.visualstudio.com/), 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
|
## Upgrading
|
||||||
|
|
||||||
The process of upgrading Cmder depends on the version/build you are currently running
|
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:
|
If you have a `[cmder_root]/config/user-conemu.xml`, you are running a newer version of Cmder, follow the below process:
|
||||||
|
|
||||||
@ -248,7 +265,7 @@ If you have a `[cmder_root]/config/user-conemu.xml`, you are running a newer ver
|
|||||||
|
|
||||||
2. Exit all Cmder sessions and backup any files you have manually edited under `[cmder_root]/vendor`.
|
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.
|
* 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.
|
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.
|
4. Extract the new `cmder.zip` or `cmder_mini.zip` into `[cmder_root]/` overwriting all files when prompted.
|
||||||
@ -259,7 +276,7 @@ If you do not have a `[cmder_root]/config/user-conemu.xml`, you are running an o
|
|||||||
|
|
||||||
2. Backup any files you have manually edited under `[cmder_root]/vendor`.
|
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.
|
* 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.
|
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.
|
4. Extract the new `cmder.zip` or `cmder_mini.zip` into `[cmder_root]/` overwriting all files when prompted.
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
<value name="FadeInactive" type="hex" data="01"/>
|
<value name="FadeInactive" type="hex" data="01"/>
|
||||||
<value name="FadeInactiveLow" type="hex" data="00"/>
|
<value name="FadeInactiveLow" type="hex" data="00"/>
|
||||||
<value name="FadeInactiveHigh" type="hex" data="c8"/>
|
<value name="FadeInactiveHigh" type="hex" data="c8"/>
|
||||||
|
<value name="ComSpec.UncPaths" type="hex" data="01"/>
|
||||||
<value name="ConVisible" type="hex" data="00"/>
|
<value name="ConVisible" type="hex" data="00"/>
|
||||||
<value name="ConInMode" type="dword" data="ffffffff"/>
|
<value name="ConInMode" type="dword" data="ffffffff"/>
|
||||||
<value name="UseInjects" type="hex" data="01"/>
|
<value name="UseInjects" type="hex" data="01"/>
|
||||||
@ -507,7 +508,7 @@
|
|||||||
<value name="Name" type="string" data="{PowerShell::PowerShell as Admin}"/>
|
<value name="Name" type="string" data="{PowerShell::PowerShell as Admin}"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''""/>
|
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
@ -516,8 +517,8 @@
|
|||||||
<value name="Name" type="string" data="{PowerShell::PowerShell}"/>
|
<value name="Name" type="string" data="{PowerShell::PowerShell}"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''""/>
|
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||||
<value name="Cmd2" type="string" data="%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe"/>
|
<value name="Cmd2" type="string" data=""%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe""/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
@ -527,7 +528,7 @@
|
|||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
||||||
<value name="Cmd1" type="string" data="*%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe /bin/bash -l"/>
|
<value name="Cmd1" type="string" data="*"%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l"/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
</key>
|
</key>
|
||||||
@ -536,10 +537,10 @@
|
|||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
||||||
<value name="Cmd1" type="string" data="%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe /bin/bash -l"/>
|
<value name="Cmd1" type="string" data=""%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l"/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Cmd2" type="string" data="%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe /bin/bash -l"/>
|
<value name="Cmd2" type="string" data=""%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe" /bin/bash -l"/>
|
||||||
</key>
|
</key>
|
||||||
<key name="Task7" modified="2018-02-22 06:05:13" build="171109">
|
<key name="Task7" modified="2018-02-22 06:05:13" build="171109">
|
||||||
<value name="Name" type="string" data="{bash::bash as Admin}"/>
|
<value name="Name" type="string" data="{bash::bash as Admin}"/>
|
||||||
@ -548,14 +549,14 @@
|
|||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Cmd1" type="string" data="*cmd /c "%ConEmuDir%\..\git-for-windows\bin\bash --login -i""/>
|
<value name="Cmd1" type="string" data="*cmd /c ""%ConEmuDir%\..\git-for-windows\bin\bash" --login -i""/>
|
||||||
</key>
|
</key>
|
||||||
<key name="Task8" modified="2018-02-22 06:05:13" build="171109">
|
<key name="Task8" modified="2018-02-22 06:05:13" build="171109">
|
||||||
<value name="Name" type="string" data="{bash::bash}"/>
|
<value name="Name" type="string" data="{bash::bash}"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Cmd1" type="string" data="cmd /c "%ConEmuDir%\..\git-for-windows\bin\bash --login -i""/>
|
<value name="Cmd1" type="string" data="cmd /c ""%ConEmuDir%\..\git-for-windows\bin\bash" --login -i""/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
</key>
|
</key>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
@ -61,6 +61,9 @@
|
|||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>src/app.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
@ -84,6 +87,9 @@
|
|||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
</Link>
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>src/app.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
|
<Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#pragma comment(lib, "Shlwapi.lib")
|
#pragma comment(lib, "Shlwapi.lib")
|
||||||
|
#pragma warning( disable : 4091 )
|
||||||
|
|
||||||
#ifndef UNICODE
|
#ifndef UNICODE
|
||||||
#error "Must be compiled with unicode support."
|
#error "Must be compiled with unicode support."
|
||||||
@ -85,6 +86,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
|
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
|
||||||
wchar_t userBinDirPath[MAX_PATH] = { 0 };
|
wchar_t userBinDirPath[MAX_PATH] = { 0 };
|
||||||
wchar_t userProfiledDirPath[MAX_PATH] = { 0 };
|
wchar_t userProfiledDirPath[MAX_PATH] = { 0 };
|
||||||
|
wchar_t userProfilePath[MAX_PATH] = { 0 };
|
||||||
|
wchar_t legacyUserProfilePath[MAX_PATH] = { 0 };
|
||||||
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
|
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
|
||||||
|
|
||||||
std::wstring cmderStart = path;
|
std::wstring cmderStart = path;
|
||||||
@ -104,6 +107,21 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
PathCombine(icoPath, exeDir, L"icons\\cmder.ico");
|
PathCombine(icoPath, exeDir, L"icons\\cmder.ico");
|
||||||
|
|
||||||
PathCombine(configDirPath, exeDir, L"config");
|
PathCombine(configDirPath, exeDir, L"config");
|
||||||
|
|
||||||
|
PathCombine(legacyUserProfilePath, configDirPath, L"user-profile.cmd");
|
||||||
|
if (PathFileExists(legacyUserProfilePath)) {
|
||||||
|
PathCombine(userProfilePath, configDirPath, L"user_profile.cmd");
|
||||||
|
|
||||||
|
char *lPr = (char *)malloc(MAX_PATH);
|
||||||
|
char *pR = (char *)malloc(MAX_PATH);
|
||||||
|
size_t i;
|
||||||
|
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||||
|
legacyUserProfilePath, (size_t)MAX_PATH);
|
||||||
|
wcstombs_s(&i, pR, (size_t)MAX_PATH,
|
||||||
|
userProfilePath, (size_t)MAX_PATH);
|
||||||
|
rename(lPr, pR);
|
||||||
|
}
|
||||||
|
|
||||||
if (wcscmp(userConfigDirPath, L"") == 0)
|
if (wcscmp(userConfigDirPath, L"") == 0)
|
||||||
{
|
{
|
||||||
PathCombine(userConfigDirPath, exeDir, L"config");
|
PathCombine(userConfigDirPath, exeDir, L"config");
|
||||||
@ -118,6 +136,20 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
|
|
||||||
PathCombine(userProfiledDirPath, userConfigDirPath, L"profile.d");
|
PathCombine(userProfiledDirPath, userConfigDirPath, L"profile.d");
|
||||||
SHCreateDirectoryEx(0, userProfiledDirPath, 0);
|
SHCreateDirectoryEx(0, userProfiledDirPath, 0);
|
||||||
|
|
||||||
|
PathCombine(legacyUserProfilePath, userConfigDirPath, L"user-profile.cmd");
|
||||||
|
if (PathFileExists(legacyUserProfilePath)) {
|
||||||
|
PathCombine(userProfilePath, userConfigDirPath, L"user_profile.cmd");
|
||||||
|
|
||||||
|
char *lPr = (char *)malloc(MAX_PATH);
|
||||||
|
char *pR = (char *)malloc(MAX_PATH);
|
||||||
|
size_t i;
|
||||||
|
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||||
|
legacyUserProfilePath, (size_t)MAX_PATH);
|
||||||
|
wcstombs_s(&i, pR, (size_t)MAX_PATH,
|
||||||
|
userProfilePath, (size_t)MAX_PATH);
|
||||||
|
rename(lPr, pR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set path to vendored ConEmu config file
|
// Set path to vendored ConEmu config file
|
||||||
@ -131,7 +163,6 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
|
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
|
||||||
|
|
||||||
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||||
|
|
||||||
if (PathFileExists(cpuCfgPath)) {
|
if (PathFileExists(cpuCfgPath)) {
|
||||||
if (PathFileExists(cfgPath)) {
|
if (PathFileExists(cfgPath)) {
|
||||||
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
|
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
|
||||||
@ -334,6 +365,7 @@ void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
|
|||||||
HKEY cmderKey;
|
HKEY cmderKey;
|
||||||
// FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
// FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
||||||
FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL));
|
FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL));
|
||||||
|
RegDeleteKeyEx(root, keyBaseName, KEY_ALL_ACCESS, NULL);
|
||||||
RegCloseKey(cmderKey);
|
RegCloseKey(cmderKey);
|
||||||
RegCloseKey(root);
|
RegCloseKey(root);
|
||||||
}
|
}
|
||||||
@ -385,7 +417,7 @@ cmderOptions GetOption()
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MessageBox(NULL, szArgList[i + 1], L"/START - Folder doses not exist!", MB_OK);
|
MessageBox(NULL, szArgList[i + 1], L"/START - Folder does not exist!", MB_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_wcsicmp(L"/task", szArgList[i]) == 0)
|
else if (_wcsicmp(L"/task", szArgList[i]) == 0)
|
||||||
|
Binary file not shown.
54
launcher/src/app.manifest
Normal file
54
launcher/src/app.manifest
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
|
||||||
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
|
||||||
|
<!-- Project description definition -->
|
||||||
|
<description>Cmder Console Emulator</description>
|
||||||
|
|
||||||
|
<!-- Project dependency definition -->
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity
|
||||||
|
type="win32"
|
||||||
|
name="Microsoft.Windows.Common-Controls"
|
||||||
|
version="6.0.0.0" processorArchitecture="*"
|
||||||
|
publicKeyToken="6595b64144ccf1df"
|
||||||
|
language="*" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Win32 User Account Control definition -->
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges>
|
||||||
|
<requestedExecutionLevel
|
||||||
|
level="asInvoker"
|
||||||
|
uiAccess="false" />
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
|
||||||
|
<!-- Required for appcompat behaviour -->
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- Windows Vista -->
|
||||||
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||||
|
<!-- Windows 8 -->
|
||||||
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
|
||||||
|
<!-- Add dpi awareness -->
|
||||||
|
<asmv3:application>
|
||||||
|
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||||
|
<dpiAware>true/pm</dpiAware>
|
||||||
|
</asmv3:windowsSettings>
|
||||||
|
</asmv3:application>
|
||||||
|
|
||||||
|
</assembly>
|
27
launcher/src/version.rc2.sample
Normal file
27
launcher/src/version.rc2.sample
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* WARNING: do NOT modify this file! the content of this file should be
|
||||||
|
* automatically genereted before AppVeyor builds using the
|
||||||
|
* respective .ps1 Powershell scripts.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Define the version numbers and build information manually here:
|
||||||
|
|
||||||
|
#define CMDER_MAJOR_VERSION {Cmder-Major-Version}
|
||||||
|
#define CMDER_MINOR_VERSION {Cmder-Minor-Version}
|
||||||
|
#define CMDER_REVISION_VERSION {Cmder-Revision-Version}
|
||||||
|
#define CMDER_BUILD_VERSION {Cmder-Build-Version}
|
||||||
|
#define CMDER_VERSION_STR {Cmder-Version-Str}
|
||||||
|
|
||||||
|
#define CMDER_PRODUCT_NAME_STR "Cmder"
|
||||||
|
#define CMDER_FILE_DESCRIPTION_STR "Cmder: Lovely Console Emulator."
|
||||||
|
#define CMDER_INTERNAL_NAME_STR "Cmder"
|
||||||
|
#define CMDER_ORIGINAL_FILENAME_STR "Cmder.exe"
|
||||||
|
#define CMDER_COMPANY_NAME_STR "Samuel Vasko"
|
||||||
|
#define CMDER_COPYRIGHT_YEAR_STR "2016"
|
||||||
|
|
||||||
|
#define CMDER_DEBUGFLAG 0x0L // set to 0x1L to enable debug mode
|
||||||
|
#define CMDER_BUILDFLAGS 0x0L
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
@ -58,12 +58,15 @@ $ScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
|
|||||||
$cmder_root = $ScriptRoot.replace("\scripts","")
|
$cmder_root = $ScriptRoot.replace("\scripts","")
|
||||||
|
|
||||||
# Dot source util functions into this scope
|
# Dot source util functions into this scope
|
||||||
. ".\utils.ps1"
|
. "$PSScriptRoot\utils.ps1"
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
Push-Location -Path $saveTo
|
Push-Location -Path $saveTo
|
||||||
$sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json
|
$sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json
|
||||||
|
|
||||||
|
# Get the version string
|
||||||
|
$version = Get-VersionStr
|
||||||
|
|
||||||
# Check for requirements
|
# Check for requirements
|
||||||
Ensure-Exists $sourcesPath
|
Ensure-Exists $sourcesPath
|
||||||
Ensure-Executable "7z"
|
Ensure-Executable "7z"
|
||||||
@ -116,10 +119,17 @@ Pop-Location
|
|||||||
|
|
||||||
if($Compile) {
|
if($Compile) {
|
||||||
Push-Location -Path $launcher
|
Push-Location -Path $launcher
|
||||||
msbuild CmderLauncher.vcxproj /p:configuration=Release
|
Create-RC $version ($launcher + '\src\version.rc2');
|
||||||
|
msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release
|
||||||
if ($LastExitCode -ne 0) {
|
if ($LastExitCode -ne 0) {
|
||||||
throw "msbuild failed to build the executable."
|
throw "msbuild failed to build the executable."
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Write-Verbose "successfully built Cmder v$version!"
|
||||||
|
if ( $Env:APPVEYOR -eq 'True' ) {
|
||||||
|
Add-AppveyorMessage -Message "Building Cmder v$version was successful." -Category Information
|
||||||
|
}
|
||||||
|
}
|
||||||
Pop-Location
|
Pop-Location
|
||||||
} else {
|
} else {
|
||||||
Write-Warning "You are not building a launcher, Use -Compile"
|
Write-Warning "You are not building a launcher, Use -Compile"
|
||||||
|
@ -48,7 +48,7 @@ $targets = @{
|
|||||||
Delete-Existing "..\Version*"
|
Delete-Existing "..\Version*"
|
||||||
Delete-Existing "..\build\*"
|
Delete-Existing "..\build\*"
|
||||||
|
|
||||||
$version = Invoke-Expression "git describe --abbrev=0 --tags"
|
$version = Get-VersionStr
|
||||||
(New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null
|
(New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null
|
||||||
|
|
||||||
foreach ($t in $targets.GetEnumerator()) {
|
foreach ($t in $targets.GetEnumerator()) {
|
||||||
|
@ -62,6 +62,85 @@ function Digest-Hash($path) {
|
|||||||
return Invoke-Expression "md5sum $path"
|
return Invoke-Expression "md5sum $path"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-VersionStr() {
|
||||||
|
|
||||||
|
# Clear existing variable
|
||||||
|
if ($string) { Clear-Variable -name string }
|
||||||
|
|
||||||
|
# Determine if git is available
|
||||||
|
if (Get-Command "git.exe" -ErrorAction SilentlyContinue)
|
||||||
|
{
|
||||||
|
|
||||||
|
# Determine if the current diesctory is a git repository
|
||||||
|
$GitPresent = Invoke-Expression "git rev-parse --is-inside-work-tree" -erroraction SilentlyContinue
|
||||||
|
|
||||||
|
if ( $GitPresent -eq 'true' )
|
||||||
|
{
|
||||||
|
$string = Invoke-Expression "git describe --abbrev=0 --tags"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fallback used when Git is not available
|
||||||
|
if ( -not($string) )
|
||||||
|
{
|
||||||
|
$string = Parse-Changelog ($PSScriptRoot + '\..\' + 'CHANGELOG.md')
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add build number, if AppVeyor is present
|
||||||
|
if ( $Env:APPVEYOR -eq 'True' )
|
||||||
|
{
|
||||||
|
$string = $string + '.' + $Env:APPVEYOR_BUILD_NUMBER
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove starting 'v' characters
|
||||||
|
$string = $string -replace '^v+','' # normalize version string
|
||||||
|
|
||||||
|
return $string
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Parse-Changelog($file) {
|
||||||
|
|
||||||
|
# Define the regular expression to match the version string from changelog
|
||||||
|
[regex]$regex = '^## \[(?<version>[\w\-\.]+)\]\([^\n()]+\)\s+\([^\n()]+\)$';
|
||||||
|
|
||||||
|
# Find the first match of the version string which means the latest version
|
||||||
|
$version = Select-String -Path $file -Pattern $regex | Select-Object -First 1 | % { $_.Matches.Groups[1].Value }
|
||||||
|
|
||||||
|
return $version
|
||||||
|
}
|
||||||
|
|
||||||
|
function Create-RC($string, $path) {
|
||||||
|
|
||||||
|
$version = $string + '.0.0.0.0' # padding for version string
|
||||||
|
|
||||||
|
if ( !(Test-Path "$path.sample") ) {
|
||||||
|
throw "Invalid path provided for resources file."
|
||||||
|
}
|
||||||
|
|
||||||
|
$resource = Get-Content -Path "$path.sample"
|
||||||
|
$pattern = @( "Cmder-Major-Version", "Cmder-Minor-Version", "Cmder-Revision-Version", "Cmder-Build-Version" )
|
||||||
|
$index = 0
|
||||||
|
|
||||||
|
# Replace all non-numeric characters to dots and split to array
|
||||||
|
$version = $version -replace '[^0-9]+','.' -split '\.'
|
||||||
|
|
||||||
|
foreach ($fragment in $version) {
|
||||||
|
if ( !$fragment ) { break }
|
||||||
|
elseif ($index -le $pattern.length) {
|
||||||
|
$resource = $resource.Replace( "{" + $pattern[$index++] + "}", $fragment )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add the version string
|
||||||
|
$resource = $resource.Replace( "{Cmder-Version-Str}", '"' + $string + '"' )
|
||||||
|
|
||||||
|
# Write the results
|
||||||
|
Set-Content -Path $path -Value $resource
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function Register-Cmder() {
|
function Register-Cmder() {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param
|
Param
|
||||||
@ -121,6 +200,8 @@ function Download-File {
|
|||||||
$Url,
|
$Url,
|
||||||
$File
|
$File
|
||||||
)
|
)
|
||||||
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
|
|
||||||
# I think this is the problem
|
# I think this is the problem
|
||||||
$File = $File -Replace "/", "\"
|
$File = $File -Replace "/", "\"
|
||||||
Write-Verbose "Downloading from $Url to $File"
|
Write-Verbose "Downloading from $Url to $File"
|
||||||
|
9
vendor/clink.lua
vendored
9
vendor/clink.lua
vendored
@ -41,13 +41,19 @@ local function set_prompt_filter()
|
|||||||
-- color codes: "\x1b[1;37;40m"
|
-- color codes: "\x1b[1;37;40m"
|
||||||
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m"
|
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m"
|
||||||
local lambda = "λ"
|
local lambda = "λ"
|
||||||
|
cwd = string.gsub(cwd, "%%", "{percent}")
|
||||||
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
|
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
|
||||||
|
|
||||||
if env ~= nil then
|
if env ~= nil then
|
||||||
lambda = "("..env..") "..lambda
|
lambda = "("..env..") "..lambda
|
||||||
end
|
end
|
||||||
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda)
|
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function percent_prompt_filter()
|
||||||
|
clink.prompt.value = string.gsub(clink.prompt.value, "{percent}", "%%")
|
||||||
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Resolves closest directory location for specified directory.
|
-- Resolves closest directory location for specified directory.
|
||||||
-- Navigates subsequently up one level and tries to find specified directory
|
-- Navigates subsequently up one level and tries to find specified directory
|
||||||
@ -235,7 +241,7 @@ end
|
|||||||
-- Get the status of working dir
|
-- Get the status of working dir
|
||||||
-- @return {bool}
|
-- @return {bool}
|
||||||
---
|
---
|
||||||
function get_svn_status()
|
local function get_svn_status()
|
||||||
local file = io.popen("svn status -q")
|
local file = io.popen("svn status -q")
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
file:close()
|
file:close()
|
||||||
@ -340,6 +346,7 @@ clink.prompt.register_filter(set_prompt_filter, 1)
|
|||||||
clink.prompt.register_filter(hg_prompt_filter, 50)
|
clink.prompt.register_filter(hg_prompt_filter, 50)
|
||||||
clink.prompt.register_filter(git_prompt_filter, 50)
|
clink.prompt.register_filter(git_prompt_filter, 50)
|
||||||
clink.prompt.register_filter(svn_prompt_filter, 50)
|
clink.prompt.register_filter(svn_prompt_filter, 50)
|
||||||
|
clink.prompt.register_filter(percent_prompt_filter, 51)
|
||||||
|
|
||||||
local completions_dir = clink.get_env('CMDER_ROOT')..'/vendor/clink-completions/'
|
local completions_dir = clink.get_env('CMDER_ROOT')..'/vendor/clink-completions/'
|
||||||
for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
|
for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
|
||||||
|
37
vendor/cmder.sh
vendored
37
vendor/cmder.sh
vendored
@ -1,6 +1,6 @@
|
|||||||
# DO NOT EDIT THIS FILE IT WILL BE OVERWRITTEN ON UPDATE
|
# DO NOT EDIT THIS FILE IT WILL BE OVERWRITTEN ON UPDATE
|
||||||
#
|
#
|
||||||
# Add portable user customizations ${CMDER_ROOT}/config/user-profile.sh,
|
# Add portable user customizations ${CMDER_ROOT}/config/user_profile.sh,
|
||||||
# these customizations will follow Cmder if $CMDER_ROOT is copied
|
# these customizations will follow Cmder if $CMDER_ROOT is copied
|
||||||
# to another machine.
|
# to another machine.
|
||||||
#
|
#
|
||||||
@ -14,7 +14,7 @@ function runProfiled {
|
|||||||
|
|
||||||
if [ ! "x${profile_d_scripts}" = "x" ] ; then
|
if [ ! "x${profile_d_scripts}" = "x" ] ; then
|
||||||
for x in ${profile_d_scripts} ; do
|
for x in ${profile_d_scripts} ; do
|
||||||
echo Sourcing "${1}/${x}"...
|
# echo Sourcing "${1}/${x}"...
|
||||||
. "${1}/${x}"
|
. "${1}/${x}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@ -63,21 +63,32 @@ if [ -d "${CMDER_USER_CONFIG}/profile.d" ] ; then
|
|||||||
runProfiled "${CMDER_USER_CONFIG}/profile.d"
|
runProfiled "${CMDER_USER_CONFIG}/profile.d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
|
|
||||||
. "${CMDER_ROOT}/config/user-profile.sh"
|
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
|
||||||
|
if [ -f "$CMDER_ROOT/config/user-profile.sh" ] ; then
|
||||||
|
mv "$CMDER_ROOT/config/user-profile.sh" "$CMDER_ROOT/config/user_profile.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then
|
CmderUserProfilePath="${CMDER_ROOT}/config/user_profile.sh"
|
||||||
. "${CMDER_USER_CONFIG}/user-profile.sh"
|
if [ -f "${CMDER_ROOT}/config/user_profile.sh" ] ; then
|
||||||
else
|
. "${CMDER_ROOT}/config/user_profile.sh"
|
||||||
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
|
fi
|
||||||
initialProfile="${CMDER_USER_CONFIG}/user-profile.sh"
|
|
||||||
else
|
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
|
||||||
initialProfile="${CMDER_ROOT}/config/user-profile.sh"
|
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
|
||||||
|
if [ -f "$CMDER_USER_CONFIG/user-profile.sh" ] ; then
|
||||||
|
mv "$CMDER_USER_CONFIG/user-profile.sh" "$CMDER_USER_CONFIG/user_profile.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo Creating user startup file: "${initialProfile}"
|
CmderUserProfilePath="${CMDER_USER_CONFIG}/user_profile.sh"
|
||||||
cat <<-eof >"${initialProfile}"
|
if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ] ; then
|
||||||
|
. "${CMDER_USER_CONFIG}/user_profile.sh"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "${CmderUserProfilePath}" ] ; then
|
||||||
|
echo Creating user startup file: "${CmderUserProfilePath}"
|
||||||
|
cat <<-eof >"${CmderUserProfilePath}"
|
||||||
# use this file to run your own startup commands for msys2 bash'
|
# use this file to run your own startup commands for msys2 bash'
|
||||||
|
|
||||||
# To add a new vendor to the path, do something like:
|
# To add a new vendor to the path, do something like:
|
||||||
|
30
vendor/cmder_exinit
vendored
30
vendor/cmder_exinit
vendored
@ -82,21 +82,31 @@ if [ ! "$CMDER_ROOT" = "" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
|
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
|
||||||
. "${CMDER_ROOT}/config/user-profile.sh"
|
if [ -f "$CMDER_ROOT/config/user-profile.sh" ] ; then
|
||||||
|
mv "$CMDER_ROOT/config/user-profile.sh" "$CMDER_ROOT/config/user_profile.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CmderUserProfilePath="${CMDER_ROOT}/config/user_profile.sh"
|
||||||
|
if [ -f "${CMDER_ROOT}/config/user_profile.sh" ] ; then
|
||||||
|
. "${CMDER_ROOT}/config/user_profile.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then
|
|
||||||
. "${CMDER_USER_CONFIG}/user-profile.sh"
|
|
||||||
else
|
|
||||||
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
|
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
|
||||||
initialProfile="${CMDER_USER_CONFIG}/user-profile.sh"
|
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
|
||||||
else
|
if [ -f "$CMDER_USER_CONFIG/user-profile.sh" ] ; then
|
||||||
initialProfile="${CMDER_ROOT}/config/user-profile.sh"
|
mv "$CMDER_USER_CONFIG/user-profile.sh" "$CMDER_USER_CONFIG/user_profile.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo Creating user startup file: "${initialProfile}"
|
CmderUserProfilePath="${CMDER_USER_CONFIG}/user_profile.sh"
|
||||||
cat <<-eof >"${initialProfile}"
|
if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ] ; then
|
||||||
|
. "${CMDER_USER_CONFIG}/user_profile.sh"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "${CmderUserProfilePath}" ] ; then
|
||||||
|
echo Creating user startup file: "${CmderUserProfilePath}"
|
||||||
|
cat <<-eof >"${CmderUserProfilePath}"
|
||||||
# use this file to run your own startup commands for msys2 bash'
|
# use this file to run your own startup commands for msys2 bash'
|
||||||
|
|
||||||
# To add a new vendor to the path, do something like:
|
# To add a new vendor to the path, do something like:
|
||||||
|
65
vendor/init.bat
vendored
65
vendor/init.bat
vendored
@ -4,7 +4,7 @@
|
|||||||
:: Created as part of cmder project
|
:: Created as part of cmder project
|
||||||
|
|
||||||
:: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
:: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||||
:: !!! Use "%CMDER_ROOT%\config\user-profile.cmd" to add your own startup commands
|
:: !!! Use "%CMDER_ROOT%\config\user_profile.cmd" to add your own startup commands
|
||||||
|
|
||||||
:: Use /v command line arg or set to > 0 for verbose output to aid in debugging.
|
:: Use /v command line arg or set to > 0 for verbose output to aid in debugging.
|
||||||
set verbose-output=0
|
set verbose-output=0
|
||||||
@ -36,11 +36,11 @@ call "%cmder_root%\vendor\lib\lib_profile"
|
|||||||
:var_loop
|
:var_loop
|
||||||
if "%~1" == "" (
|
if "%~1" == "" (
|
||||||
goto :start
|
goto :start
|
||||||
) else if "%1"=="/v" (
|
) else if /i "%1"=="/v" (
|
||||||
set verbose-output=1
|
set verbose-output=1
|
||||||
) else if "%1"=="/d" (
|
) else if /i "%1"=="/d" (
|
||||||
set debug-output=1
|
set debug-output=1
|
||||||
) else if "%1" == "/max_depth" (
|
) else if /i "%1" == "/max_depth" (
|
||||||
if "%~2" geq "1" if "%~2" leq "5" (
|
if "%~2" geq "1" if "%~2" leq "5" (
|
||||||
set "max_depth=%~2"
|
set "max_depth=%~2"
|
||||||
shift
|
shift
|
||||||
@ -48,7 +48,7 @@ call "%cmder_root%\vendor\lib\lib_profile"
|
|||||||
%lib_console% show_error "'/max_depth' requires a number between 1 and 5!"
|
%lib_console% show_error "'/max_depth' requires a number between 1 and 5!"
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
) else if "%1" == "/c" (
|
) else if /i "%1" == "/c" (
|
||||||
if exist "%~2" (
|
if exist "%~2" (
|
||||||
if not exist "%~2\bin" mkdir "%~2\bin"
|
if not exist "%~2\bin" mkdir "%~2\bin"
|
||||||
set "cmder_user_bin=%~2\bin"
|
set "cmder_user_bin=%~2\bin"
|
||||||
@ -56,12 +56,12 @@ call "%cmder_root%\vendor\lib\lib_profile"
|
|||||||
set "cmder_user_config=%~2\config"
|
set "cmder_user_config=%~2\config"
|
||||||
shift
|
shift
|
||||||
)
|
)
|
||||||
) else if "%1" == "/user_aliases" (
|
) else if /i "%1" == "/user_aliases" (
|
||||||
if exist "%~2" (
|
if exist "%~2" (
|
||||||
set "user-aliases=%~2"
|
set "user-aliases=%~2"
|
||||||
shift
|
shift
|
||||||
)
|
)
|
||||||
) else if "%1" == "/git_install_root" (
|
) else if /i "%1" == "/git_install_root" (
|
||||||
if exist "%~2" (
|
if exist "%~2" (
|
||||||
set "GIT_INSTALL_ROOT=%~2"
|
set "GIT_INSTALL_ROOT=%~2"
|
||||||
shift
|
shift
|
||||||
@ -69,7 +69,7 @@ call "%cmder_root%\vendor\lib\lib_profile"
|
|||||||
%lib_console% show_error "The Git install root folder "%~2", you specified does not exist!"
|
%lib_console% show_error "The Git install root folder "%~2", you specified does not exist!"
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
) else if "%1" == "/home" (
|
) else if /i "%1" == "/home" (
|
||||||
if exist "%~2" (
|
if exist "%~2" (
|
||||||
set "HOME=%~2"
|
set "HOME=%~2"
|
||||||
shift
|
shift
|
||||||
@ -77,7 +77,7 @@ call "%cmder_root%\vendor\lib\lib_profile"
|
|||||||
%lib_console% show_error The home folder "%2", you specified does not exist!
|
%lib_console% show_error The home folder "%2", you specified does not exist!
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
) else if "%1" == "/svn_ssh" (
|
) else if /i "%1" == "/svn_ssh" (
|
||||||
set SVN_SSH=%2
|
set SVN_SSH=%2
|
||||||
shift
|
shift
|
||||||
)
|
)
|
||||||
@ -129,12 +129,14 @@ if not defined TERM set TERM=cygwin
|
|||||||
:: * test if a git is in path and if yes, use that
|
:: * test if a git is in path and if yes, use that
|
||||||
:: * last, use our vendored git
|
:: * last, use our vendored git
|
||||||
:: also check that we have a recent enough version of git by examining the version string
|
:: also check that we have a recent enough version of git by examining the version string
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
if defined GIT_INSTALL_ROOT (
|
if defined GIT_INSTALL_ROOT (
|
||||||
if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" goto :FOUND_GIT)
|
if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" goto :FOUND_GIT)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
%lib_console% debug-output init.bat "Looking for Git install root..."
|
||||||
|
|
||||||
:: get the version information for vendored git binary
|
:: get the version information for vendored git binary
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
%lib_git% read_version VENDORED "%CMDER_ROOT%\vendor\git-for-windows\cmd"
|
%lib_git% read_version VENDORED "%CMDER_ROOT%\vendor\git-for-windows\cmd"
|
||||||
%lib_git% validate_version VENDORED !GIT_VERSION_VENDORED!
|
%lib_git% validate_version VENDORED !GIT_VERSION_VENDORED!
|
||||||
|
|
||||||
@ -197,17 +199,25 @@ if defined GIT_INSTALL_ROOT (
|
|||||||
) else if exist "!GIT_INSTALL_ROOT!\mingw64" (
|
) else if exist "!GIT_INSTALL_ROOT!\mingw64" (
|
||||||
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64" append
|
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64" append
|
||||||
)
|
)
|
||||||
%lib_path% enhance_path "%GIT_INSTALL_ROOT%\usr\bin" append
|
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\usr\bin" append
|
||||||
|
|
||||||
:: define SVN_SSH so we can use git svn with ssh svn repositories
|
:: define SVN_SSH so we can use git svn with ssh svn repositories
|
||||||
if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"
|
if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"
|
||||||
|
for /F "delims=" %%F in ('env /usr/bin/locale -uU 2^>nul') do (
|
||||||
|
set "LANG=%%F"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
:NO_GIT
|
endlocal & set "PATH=%PATH%" & set "LANG=%LANG%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
|
||||||
endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
|
|
||||||
%lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
|
%lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
|
||||||
|
%lib_console% debug-output init.bat "Found Git in: '%GIT_INSTALL_ROOT%'"
|
||||||
|
goto :PATH_ENHANCE
|
||||||
|
|
||||||
:: Enhance Path
|
:NO_GIT
|
||||||
|
:: Skip this if GIT WAS FOUND else we did 'endlocal' above!
|
||||||
|
endlocal
|
||||||
|
|
||||||
|
:PATH_ENHANCE
|
||||||
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" %max_depth%
|
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" %max_depth%
|
||||||
if defined CMDER_USER_BIN (
|
if defined CMDER_USER_BIN (
|
||||||
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" %max_depth%
|
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" %max_depth%
|
||||||
@ -287,16 +297,22 @@ if exist "%GIT_INSTALL_ROOT%\post-install.bat" (
|
|||||||
if not defined HOME set "HOME=%USERPROFILE%"
|
if not defined HOME set "HOME=%USERPROFILE%"
|
||||||
%lib_console% debug-output init.bat "Env Var - HOME=%HOME%"
|
%lib_console% debug-output init.bat "Env Var - HOME=%HOME%"
|
||||||
|
|
||||||
if exist "%CMDER_ROOT%\config\user-profile.cmd" (
|
set "initialConfig=%CMDER_ROOT%\config\user_profile.cmd"
|
||||||
|
if exist "%CMDER_ROOT%\config\user_profile.cmd" (
|
||||||
REM Create this file and place your own command in there
|
REM Create this file and place your own command in there
|
||||||
call "%CMDER_ROOT%\config\user-profile.cmd"
|
call "%CMDER_ROOT%\config\user_profile.cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined CMDER_USER_CONFIG if exist "%CMDER_USER_CONFIG%\user-profile.cmd" (
|
if defined CMDER_USER_CONFIG (
|
||||||
|
set "initialConfig=%CMDER_USER_CONFIG%\user_profile.cmd"
|
||||||
|
if exist "%CMDER_USER_CONFIG%\user_profile.cmd" (
|
||||||
REM Create this file and place your own command in there
|
REM Create this file and place your own command in there
|
||||||
call "%CMDER_USER_CONFIG%\user-profile.cmd"
|
call "%CMDER_USER_CONFIG%\user_profile.cmd"
|
||||||
) else (
|
)
|
||||||
echo Creating user startup file: "%CMDER_ROOT%\config\user-profile.cmd"
|
)
|
||||||
|
|
||||||
|
if not exist "%initialConfig%" (
|
||||||
|
echo Creating user startup file: "%initialConfig%"
|
||||||
(
|
(
|
||||||
echo :: use this file to run your own startup commands
|
echo :: use this file to run your own startup commands
|
||||||
echo :: use in front of the command to prevent printing the command
|
echo :: use in front of the command to prevent printing the command
|
||||||
@ -312,13 +328,8 @@ echo :: you can add your plugins to the cmder path like so
|
|||||||
echo :: set "PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%"
|
echo :: set "PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%"
|
||||||
echo.
|
echo.
|
||||||
echo @echo off
|
echo @echo off
|
||||||
) >"%temp%\user-profile.tmp"
|
) >"%initialConfig%"
|
||||||
|
|
||||||
if defined CMDER_USER_CONFIG (
|
|
||||||
copy "%temp%\user-profile.tmp" "%CMDER_USER_CONFIG%\user-profile.cmd"
|
|
||||||
) else (
|
|
||||||
copy "%temp%\user-profile.tmp" "%CMDER_ROOT%\config\user-profile.cmd"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set initialConfig=
|
||||||
exit /b
|
exit /b
|
||||||
|
7
vendor/lib/lib_base.cmd
vendored
7
vendor/lib/lib_base.cmd
vendored
@ -3,7 +3,7 @@
|
|||||||
set lib_base=call "%~dp0lib_base.cmd"
|
set lib_base=call "%~dp0lib_base.cmd"
|
||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
@ -16,7 +16,7 @@ exit /b
|
|||||||
:::.
|
:::.
|
||||||
:::include:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
::: call "$0"
|
::: call "lib_base.cmd"
|
||||||
:::.
|
:::.
|
||||||
:::usage:
|
:::usage:
|
||||||
:::.
|
:::.
|
||||||
@ -27,12 +27,9 @@ exit /b
|
|||||||
::: file <in> full path to file containing lib_routines to display
|
::: file <in> full path to file containing lib_routines to display
|
||||||
:::.
|
:::.
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
for /f "tokens=* delims=:" %%a in ('type "%~1" ^| findstr /i /r "^:::"') do (
|
for /f "tokens=* delims=:" %%a in ('type "%~1" ^| findstr /i /r "^:::"') do (
|
||||||
rem echo a="%%a"
|
rem echo a="%%a"
|
||||||
|
|
||||||
if "%%a"==" " (
|
|
||||||
echo.
|
|
||||||
if "%%a"=="." (
|
if "%%a"=="." (
|
||||||
echo.
|
echo.
|
||||||
) else if /i "%%a" == "usage" (
|
) else if /i "%%a" == "usage" (
|
||||||
|
5
vendor/lib/lib_console.cmd
vendored
5
vendor/lib/lib_console.cmd
vendored
@ -6,7 +6,7 @@ call "%~dp0lib_base.cmd"
|
|||||||
set lib_console=call "%~dp0lib_console.cmd"
|
set lib_console=call "%~dp0lib_console.cmd"
|
||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
@ -19,7 +19,7 @@ exit /b
|
|||||||
:::.
|
:::.
|
||||||
:::include:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
::: call "$0"
|
::: call "lib_console.cmd"
|
||||||
:::.
|
:::.
|
||||||
:::usage:
|
:::usage:
|
||||||
:::.
|
:::.
|
||||||
@ -76,5 +76,4 @@ exit /b
|
|||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
echo ERROR: %~1
|
echo ERROR: %~1
|
||||||
echo CMDER Shell Initialization has Failed!
|
|
||||||
exit /b
|
exit /b
|
||||||
|
6
vendor/lib/lib_git.cmd
vendored
6
vendor/lib/lib_git.cmd
vendored
@ -7,7 +7,7 @@ set lib_git=call "%~dp0lib_git.cmd"
|
|||||||
|
|
||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
@ -20,7 +20,7 @@ exit /b
|
|||||||
:::.
|
:::.
|
||||||
:::include:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
::: call "$0"
|
::: call "lib_git.cmd"
|
||||||
:::.
|
:::.
|
||||||
:::usage:
|
:::usage:
|
||||||
:::.
|
:::.
|
||||||
@ -46,7 +46,7 @@ exit /b
|
|||||||
|
|
||||||
:: check if the executable actually exists
|
:: check if the executable actually exists
|
||||||
if not exist "%git_executable%" (
|
if not exist "%git_executable%" (
|
||||||
%lib_console% show_error "%git_executable%" does not exist!
|
%lib_console% debug-output :read_version "%git_executable% does not exist."
|
||||||
exit /b -255
|
exit /b -255
|
||||||
)
|
)
|
||||||
|
|
||||||
|
4
vendor/lib/lib_path.cmd
vendored
4
vendor/lib/lib_path.cmd
vendored
@ -6,7 +6,7 @@ call "%%~dp0lib_console"
|
|||||||
set lib_path=call "%~dp0lib_path.cmd"
|
set lib_path=call "%~dp0lib_path.cmd"
|
||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
@ -19,7 +19,7 @@ exit /b
|
|||||||
:::
|
:::
|
||||||
:::include:
|
:::include:
|
||||||
:::
|
:::
|
||||||
::: call "$0"
|
::: call "lib_path.cmd"
|
||||||
:::
|
:::
|
||||||
:::usage:
|
:::usage:
|
||||||
:::
|
:::
|
||||||
|
4
vendor/lib/lib_profile.cmd
vendored
4
vendor/lib/lib_profile.cmd
vendored
@ -6,7 +6,7 @@ call "%%~dp0lib_console"
|
|||||||
set lib_profile=call "%~dp0lib_profile.cmd"
|
set lib_profile=call "%~dp0lib_profile.cmd"
|
||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
@ -19,7 +19,7 @@ exit /b
|
|||||||
:::
|
:::
|
||||||
:::include:
|
:::include:
|
||||||
:::
|
:::
|
||||||
::: call "$0"
|
::: call "lib_profile.cmd"
|
||||||
:::
|
:::
|
||||||
:::usage:
|
:::usage:
|
||||||
:::
|
:::
|
||||||
|
34
vendor/profile.ps1
vendored
34
vendor/profile.ps1
vendored
@ -2,7 +2,7 @@
|
|||||||
# Created as part of cmder project
|
# Created as part of cmder project
|
||||||
|
|
||||||
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||||
# !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands
|
# !!! Use "%CMDER_ROOT%\config\user_profile.ps1" to add your own startup commands
|
||||||
|
|
||||||
# Compatibility with PS major versions <= 2
|
# Compatibility with PS major versions <= 2
|
||||||
if(!$PSScriptRoot) {
|
if(!$PSScriptRoot) {
|
||||||
@ -97,7 +97,7 @@ $env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT"
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Prompt Section
|
# Prompt Section
|
||||||
# Users should modify their user-profile.ps1 as it will be safe from updates.
|
# Users should modify their user_profile.ps1 as it will be safe from updates.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Pre assign the hooks so the first run of cmder gets a working prompt.
|
# Pre assign the hooks so the first run of cmder gets a working prompt.
|
||||||
@ -134,37 +134,45 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) {
|
|||||||
pushd $ENV:CMDER_ROOT\config\profile.d
|
pushd $ENV:CMDER_ROOT\config\profile.d
|
||||||
foreach ($x in Get-ChildItem *.ps1) {
|
foreach ($x in Get-ChildItem *.ps1) {
|
||||||
# write-host write-host Sourcing $x
|
# write-host write-host Sourcing $x
|
||||||
. $x
|
Import-Module $x
|
||||||
}
|
}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Drop *.ps1 files into "$ENV:CMDER_USER_CONFIG\config\profile.d"
|
# Drop *.ps1 files into "$ENV:CMDER_USER_CONFIG\config\profile.d"
|
||||||
# to source them at startup. Requires using cmder.exe /C [cmder_user_root_path] argument
|
# to source them at startup. Requires using cmder.exe /C [cmder_user_root_path] argument
|
||||||
if ($ENV:CMDER_USER_CONFIG -ne "" -and -not (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) {
|
if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) {
|
||||||
pushd $ENV:CMDER_USER_CONFIG\profile.d
|
pushd $ENV:CMDER_USER_CONFIG\profile.d
|
||||||
foreach ($x in Get-ChildItem *.ps1) {
|
foreach ($x in Get-ChildItem *.ps1) {
|
||||||
# write-host write-host Sourcing $x
|
# write-host write-host Sourcing $x
|
||||||
. $x
|
Import-Module $x
|
||||||
}
|
}
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Renaming to "config\user_profile.ps1" to "user_profile.ps1" for consistency.
|
||||||
|
if (test-path "$env:CMDER_ROOT\config\user-profile.ps1") {
|
||||||
|
rename-item "$env:CMDER_ROOT\config\user-profile.ps1" user_profile.ps1
|
||||||
|
}
|
||||||
|
|
||||||
|
$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user_profile.ps1"
|
||||||
$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1"
|
|
||||||
if (Test-Path $CmderUserProfilePath) {
|
if (Test-Path $CmderUserProfilePath) {
|
||||||
# Create this file and place your own command in there.
|
# Create this file and place your own command in there.
|
||||||
. "$CmderUserProfilePath"
|
Import-Module "$CmderUserProfilePath"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ENV:CMDER_USER_CONFIG) {
|
if ($ENV:CMDER_USER_CONFIG) {
|
||||||
$CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1"
|
# Renaming to "$env:CMDER_USER_CONFIG\user-profile.ps1" to "user_profile.ps1" for consistency.
|
||||||
|
if (test-path "$env:CMDER_USER_CONFIG\user-profile.ps1") {
|
||||||
|
rename-item "$env:CMDER_USER_CONFIG\user-profile.ps1" user_profile.ps1
|
||||||
|
}
|
||||||
|
|
||||||
|
$CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user_profile.ps1"
|
||||||
|
if (Test-Path $CmderUserProfilePath) {
|
||||||
|
Import-Module "$CmderUserProfilePath"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Test-Path $CmderUserProfilePath) {
|
if (! (Test-Path $CmderUserProfilePath) ) {
|
||||||
. "$CmderUserProfilePath"
|
|
||||||
} else {
|
|
||||||
# This multiline string cannot be indented, for this reason I've not indented the whole block
|
# This multiline string cannot be indented, for this reason I've not indented the whole block
|
||||||
|
|
||||||
Write-Host -BackgroundColor Darkgreen -ForegroundColor White "First Run: Creating user startup file: $CmderUserProfilePath"
|
Write-Host -BackgroundColor Darkgreen -ForegroundColor White "First Run: Creating user startup file: $CmderUserProfilePath"
|
||||||
|
8
vendor/sources.json
vendored
8
vendor/sources.json
vendored
@ -1,8 +1,8 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "git-for-windows",
|
"name": "git-for-windows",
|
||||||
"version": "v2.16.3.windows.1",
|
"version": "v2.17.1.windows.2",
|
||||||
"url": "https://github.com/git-for-windows/git/releases/download/v2.16.3.windows.1/PortableGit-2.16.3-64-bit.7z.exe"
|
"url": "https://github.com/git-for-windows/git/releases/download/v2.17.1.windows.2/PortableGit-2.17.1.2-64-bit.7z.exe"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "clink",
|
"name": "clink",
|
||||||
@ -11,8 +11,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "conemu-maximus5",
|
"name": "conemu-maximus5",
|
||||||
"version": "180318",
|
"version": "180528",
|
||||||
"url": "https://github.com/Maximus5/ConEmu/releases/download/v18.03.18/ConEmuPack.180318.7z"
|
"url": "https://github.com/Maximus5/ConEmu/releases/download/v18.05.28/ConEmuPack.180528.7z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "clink-completions",
|
"name": "clink-completions",
|
||||||
|
Loading…
Reference in New Issue
Block a user