mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
Merge remote-tracking branch 'upstream/development' into development
This commit is contained in:
commit
6e3b83460c
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,5 +8,7 @@ vendor/*/*
|
||||
config/.history
|
||||
Thumbs.db
|
||||
*.exe
|
||||
*.dll
|
||||
build/
|
||||
Version v*
|
||||
*.bak
|
||||
|
38
CONTRIBUTING.md
Normal file
38
CONTRIBUTING.md
Normal file
@ -0,0 +1,38 @@
|
||||
# How to contribute
|
||||
|
||||
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 development branch.
|
||||
|
||||
## Making Changes
|
||||
|
||||
* Make changes in your seperate 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.
|
||||
|
||||
|
||||
# Additional Resources
|
||||
|
||||
* [Squashing Commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)
|
||||
* [General GitHub documentation](http://help.github.com/)
|
||||
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
|
98
README.md
Normal file
98
README.md
Normal file
@ -0,0 +1,98 @@
|
||||
# Cmder
|
||||
|
||||
[![Join the chat at https://gitter.im/bliker/cmder](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cmderdev/cmder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
![Build Status](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?retina=true)
|
||||
|
||||
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://github.com/mridgers/clink) (further enhanced by [clink-completions](https://github.com/vladimir-kotikov/clink-completions)) and a custom prompt layout.
|
||||
|
||||
![Cmder Screenshot](http://i.imgur.com/g1nNf0I.png)
|
||||
|
||||
## Why use it
|
||||
|
||||
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 **cloud storage**. So you can carry your console, aliases and binaries (like wget, curl and git) with you anywhere.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Download the [latest release](https://github.com/cmderdev/cmder/releases/)
|
||||
2. Extract
|
||||
3. (optional) Place your own executable files into the `bin` folder to be injected into your PATH.
|
||||
4. Run Cmder
|
||||
|
||||
## Integration
|
||||
|
||||
So you've experimented with Cmder a little and want to give it a shot in a more permanent home;
|
||||
|
||||
### Shortcut to open Cmder in a chosen folder
|
||||
|
||||
1. Open a terminal as an Administrator
|
||||
2. Navigate to the directory you have placed Cmder
|
||||
3. Execute `.\cmder.exe /REGISTER ALL`
|
||||
_If you get a message "Access Denied" ensure you are executing the command in an **Administrator** prompt._
|
||||
|
||||
In a file explorer window right click in or on a directory to see "Cmder Here" in the context menu.
|
||||
|
||||
## Keyboard shortcuts
|
||||
|
||||
### Tab manipulation
|
||||
|
||||
* <kbd>Ctrl</kbd> + <kbd>T</kbd> : New tab dialog (maybe you want to open cmd as admin?)
|
||||
* <kbd>Ctrl</kbd> + <kbd>W</kbd> : Close tab
|
||||
* <kbd>Ctrl</kbd> + <kbd>D</kbd> : Close tab (if pressed on empty command)
|
||||
* <kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>#Number</kbd> : Fast new tab: <kbd>1</kbd> - CMD, <kbd>2</kbd> - PowerShell
|
||||
* <kbd>Alt</kbd> + <kbd>Enter</kbd>: Fullscreen
|
||||
|
||||
### Shell
|
||||
|
||||
* <kbd>Shift</kbd> + <kbd>Up</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, 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
|
||||
|
||||
### SSH Agent
|
||||
|
||||
To start 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 `/config/user-startup.bat` (usually just uncomment it).
|
||||
|
||||
## Todo
|
||||
|
||||
1. Git Bash
|
||||
2. Check for clink and git before injecting them (Sort of done)
|
||||
|
||||
## License
|
||||
|
||||
All software included is bundled with own license
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 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
|
||||
THE SOFTWARE.
|
102
Readme.md
102
Readme.md
@ -1,102 +0,0 @@
|
||||
# Cmder
|
||||
|
||||
Latest release is **[v1.1.4.1](https://github.com/bliker/cmder/releases/tag/v1.1.4.1)**
|
||||
|
||||
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://github.com/mridgers/clink) and custom prompt layout.
|
||||
|
||||
![Cmder Screenshot](http://i.imgur.com/g1nNf0I.png)
|
||||
|
||||
## Why use it
|
||||
|
||||
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 your own executable files into the `bin` folder to be injected into your PATH.
|
||||
1. Run cmder
|
||||
|
||||
*(There will be a version with installer)*
|
||||
|
||||
## Integration
|
||||
|
||||
So you've experimented with cmder a little and want to give it a shot in a more permanent home;
|
||||
|
||||
### Shortcut to open Cmder in a chosen folder
|
||||
|
||||
1. Open a terminal as an Administrator
|
||||
1. Navigate to the directory you have placed Cmder
|
||||
1. Execute `.\cmder.exe /REGISTER ALL`*
|
||||
|
||||
In a file explorer window right click in or on a directory to see "Cmder Here" in the context menu.
|
||||
|
||||
*If you get a message "Access Denied" ensure you are executing the command in an Administrator prompt.
|
||||
|
||||
## 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
|
||||
|
||||
### SSH Agent
|
||||
|
||||
To start SSH agent simply call `agent`, which is in the `bin` folder.
|
||||
|
||||
If you want to run SSH agent on startup, uncomment the line in `/vendor/init.bat`so it says `@call "%CMDER_ROOT%/bin/agent.cmd"`.
|
||||
|
||||
## 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. Git Bash
|
||||
5. Check for clink and git before injecting them
|
||||
|
||||
## License
|
||||
|
||||
All software included is bundled with own license
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 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
|
||||
THE SOFTWARE.
|
40
appveyor.yml
Normal file
40
appveyor.yml
Normal file
@ -0,0 +1,40 @@
|
||||
#---------------------------------#
|
||||
# general configuration #
|
||||
#---------------------------------#
|
||||
|
||||
version: 1.0.{build}-{branch}
|
||||
|
||||
# branches to build
|
||||
branches:
|
||||
# blacklist
|
||||
except:
|
||||
- gh-pages
|
||||
|
||||
# Do not build on tags
|
||||
skip_tags: true
|
||||
|
||||
#---------------------------------#
|
||||
# environment configuration #
|
||||
#---------------------------------#
|
||||
|
||||
# Operating system (build VM template)
|
||||
os: Windows Server 2012 R2
|
||||
|
||||
#---------------------------------#
|
||||
# build configuration #
|
||||
#---------------------------------#
|
||||
|
||||
build_script:
|
||||
- ps: cd scripts; .\build.ps1 -Compile -verbose
|
||||
|
||||
#---------------------------------#
|
||||
# notifications #
|
||||
#---------------------------------#
|
||||
|
||||
notifications:
|
||||
# Webhook
|
||||
- provider: Webhook
|
||||
url: https://webhooks.gitter.im/e/f7b9c3ae66741c2e046e
|
||||
on_build_success: true
|
||||
on_build_failure: true
|
||||
on_build_status_changed: true
|
@ -1,46 +0,0 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Set default sock file
|
||||
SET SSH_AUTH_SOCK=/tmp/ssh-agent.sock
|
||||
|
||||
REM Check socket is available
|
||||
IF NOT EXIST "%TMP%\ssh-agent.sock" GOTO:RUNAGENT
|
||||
|
||||
REM Check if an ssh-agent is running
|
||||
FOR /f "tokens=*" %%I IN ('ps ^| grep ssh-agent ^| sed "s/^ *\([0-9]\+\) .*/\1/"') DO SET VAR=%%I
|
||||
IF "%VAR%" == "" GOTO:RUNAGENT
|
||||
|
||||
REM Check if socket file is valid
|
||||
ssh-add -l 1> NUL 2>&1
|
||||
IF ERRORLEVEL 1 GOTO:RUNAGENT
|
||||
GOTO:ADDKEYS
|
||||
|
||||
:RUNAGENT
|
||||
REM Remove old socket file
|
||||
rm -f /tmp/ssh-agent.sock
|
||||
|
||||
REM Run ssh-agent and save (last) PID in VAR
|
||||
SET VAR=
|
||||
FOR /f "tokens=*" %%J IN ('ssh-agent -a /tmp/ssh-agent.sock') DO FOR /f "tokens=*" %%K IN ('echo %%J ^| grep "SSH_AGENT_PID" ^| sed "s/^SSH_AGENT_PID=\([0-9]\+\); .*/\1/"') DO SET VAR=%%K
|
||||
|
||||
:ADDKEYS
|
||||
SET SSH_AUTH_PID=%VAR%
|
||||
|
||||
REM Check if ssh keys are known
|
||||
SET KEYS=
|
||||
FOR /f "tokens=*" %%I IN ('DIR /B "%HOME%\.ssh\*_rsa"') DO CALL:CHECKKEY %%I
|
||||
|
||||
REM Add missing ssh keys at once
|
||||
IF NOT "%KEYS%" == "" ssh-add %KEYS%
|
||||
GOTO:END
|
||||
|
||||
REM Functions
|
||||
REM Check if ssh key has to be added
|
||||
:CHECKKEY
|
||||
SET VAR=
|
||||
FOR /f "tokens=*" %%J IN ('ssh-add -l ^| grep "%1"') DO SET VAR=%%J
|
||||
IF "%VAR%" == "" SET KEYS='%HOME%\.ssh\%1' %KEYS%
|
||||
GOTO:EOF
|
||||
|
||||
:END
|
||||
@ECHO ON
|
@ -1,27 +1,35 @@
|
||||
@echo off
|
||||
|
||||
set ALIASES=%CMDER_ROOT%\config\aliases
|
||||
setlocal
|
||||
:: handle quotes within command definition, e.g. quoted long file names
|
||||
set _x="%*"
|
||||
set _x=%_x:"=%
|
||||
|
||||
if ["%*"] == [""] echo Use /? for help & echo. & goto :p_show
|
||||
:: check command usage
|
||||
if ["%_x%"] == [""] echo Use /? for help & echo. & goto :p_show
|
||||
if ["%1"] == ["/?"] goto:p_help
|
||||
if ["%1"] == ["/reload"] goto:p_reload
|
||||
:: /d flag for delete existing alias
|
||||
if ["%1"] == ["/d"] goto:p_del %*
|
||||
if ["%2"] == [""] echo Insufficient parameters. & goto:p_help
|
||||
::validate alias
|
||||
setlocal
|
||||
for /f "delims== tokens=1" %%G in ("%*") do set _temp2=%%G
|
||||
:: if arg is an existing alias, display it
|
||||
if ["%2"] == [""] (
|
||||
doskey /macros | findstr /b %1= && goto:eof
|
||||
echo Insufficient parameters. & goto:p_help
|
||||
)
|
||||
|
||||
set _temp=%_temp2: =%
|
||||
:: validate alias
|
||||
for /f "delims== tokens=1" %%G in ("%_x%") do set alias=%%G
|
||||
set _temp=%alias: =%
|
||||
|
||||
if not ["%_temp%"] == ["%_temp2%"] (
|
||||
if not ["%_temp%"] == ["%alias%"] (
|
||||
echo Your alias name can not contain a space
|
||||
endlocal
|
||||
goto:eof
|
||||
)
|
||||
|
||||
:: replace already defined alias
|
||||
findstr /b /v /i "%_temp%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
findstr /b /v /i "%alias%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
echo %* >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
||||
doskey /macrofile="%ALIASES%"
|
||||
endlocal
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key name="Software">
|
||||
<key name="ConEmu">
|
||||
<key name=".Vanilla" modified="2015-01-21 23:28:29" build="140707">
|
||||
<key name=".Vanilla" modified="2015-05-17 22:10:27" build="150513">
|
||||
<value name="ColorTable00" type="dword" data="00222827"/>
|
||||
<value name="ColorTable01" type="dword" data="009e5401"/>
|
||||
<value name="ColorTable02" type="dword" data="0004aa74"/>
|
||||
@ -77,7 +77,7 @@
|
||||
<value name="StartFarEditors" type="hex" data="00"/>
|
||||
<value name="StoreTaskbarkTasks" type="hex" data="00"/>
|
||||
<value name="StoreTaskbarCommands" type="hex" data="00"/>
|
||||
<value name="CmdLineHistory" type="multi"><line data=";C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\"/></value>
|
||||
<value name="CmdLineHistory" type="multi"></value>
|
||||
<value name="SingleInstance" type="hex" data="00"/>
|
||||
<value name="ShowHelpTooltips" type="hex" data="01"/>
|
||||
<value name="Multi" type="hex" data="01"/>
|
||||
@ -127,8 +127,8 @@
|
||||
<value name="ConWnd Width" type="dword" data="0000006f"/>
|
||||
<value name="ConWnd Height" type="dword" data="0000001a"/>
|
||||
<value name="Cascaded" type="hex" data="01"/>
|
||||
<value name="ConWnd X" type="dword" data="000000bc"/>
|
||||
<value name="ConWnd Y" type="dword" data="00000065"/>
|
||||
<value name="ConWnd X" type="dword" data="000003f8"/>
|
||||
<value name="ConWnd Y" type="dword" data="00000143"/>
|
||||
<value name="16bit Height" type="dword" data="00000000"/>
|
||||
<value name="AutoSaveSizePos" type="hex" data="00"/>
|
||||
<value name="IntegralSize" type="hex" data="00"/>
|
||||
@ -138,7 +138,7 @@
|
||||
<value name="HideChildCaption" type="hex" data="01"/>
|
||||
<value name="FocusInChildWindows" type="hex" data="01"/>
|
||||
<value name="HideCaptionAlways" type="hex" data="00"/>
|
||||
<value name="HideCaptionAlwaysFrame" type="hex" data="ff"/>
|
||||
<value name="HideCaptionAlwaysFrame" type="hex" data="00"/>
|
||||
<value name="HideCaptionAlwaysDelay" type="dword" data="000007d0"/>
|
||||
<value name="HideCaptionAlwaysDisappear" type="dword" data="000007d0"/>
|
||||
<value name="DownShowHiddenMessage" type="hex" data="00"/>
|
||||
@ -483,48 +483,51 @@
|
||||
<value name="DndLKey" type="hex" data="00"/>
|
||||
<value name="DndRKey" type="hex" data="a2"/>
|
||||
<value name="WndDragKey" type="dword" data="00121101"/>
|
||||
<key name="Tasks" modified="2015-01-21 23:28:29" build="140707">
|
||||
<key name="Tasks" modified="2015-05-17 22:10:27" build="150513">
|
||||
<value name="Count" type="dword" data="00000003"/>
|
||||
<key name="Task1" modified="2015-01-21 23:28:29" build="140707">
|
||||
<key name="Task1" modified="2015-05-17 22:10:27" build="150513">
|
||||
<value name="Name" type="string" data="{cmd}"/>
|
||||
<value name="GuiArgs" type="string" data="/icon "%CMDER_ROOT%\cmder.exe""/>
|
||||
<value name="Cmd1" type="string" data="cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:%USERPROFILE%"/>
|
||||
<value name="Active" type="dword" data="00000000"/>
|
||||
<value name="Count" type="dword" data="00000001"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
</key>
|
||||
<key name="Task2" modified="2015-01-21 23:28:29" build="140707">
|
||||
<key name="Task2" modified="2015-05-17 22:10:27" build="150513">
|
||||
<value name="Name" type="string" data="{PowerShell}"/>
|
||||
<value name="GuiArgs" type="string" data="/icon "%CMDER_ROOT%\cmder.exe""/>
|
||||
<value name="Cmd1" type="string" data="PowerShell -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%""/>
|
||||
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%""/>
|
||||
<value name="Active" type="dword" data="00000000"/>
|
||||
<value name="Count" type="dword" data="00000001"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
</key>
|
||||
<key name="Task3" modified="2015-01-21 23:28:29" build="140707">
|
||||
<key name="Task3" modified="2015-05-17 22:10:27" build="150513">
|
||||
<value name="Name" type="string" data="{PowerShell as Admin}"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data="/icon "%CMDER_ROOT%\cmder.exe""/>
|
||||
<value name="Cmd1" type="string" data="*PowerShell -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%""/>
|
||||
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%""/>
|
||||
<value name="Active" type="dword" data="00000000"/>
|
||||
<value name="Count" type="dword" data="00000001"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
</key>
|
||||
<key name="Task4" modified="2015-02-24 18:49:50" build="140707">
|
||||
<value name="Name" type="string" data="{git sh}"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\cmder.exe""/>
|
||||
<value name="Cmd1" type="string" data="cmd /k "%ConEmuDir%\..\init.bat & %CMDER_ROOT%\vendor\msysgit\bin\bash --login -i" -new_console:d:%USERPROFILE%"/>
|
||||
<value name="Cmd2" type="string" data="%CMDER_ROOT%\vendor\msysgit\git-bash.bat"/>
|
||||
<value name="Cmd1" type="string" data="cmd /k "%ConEmuDir%\..\init.bat & %CMDER_ROOT%\vendor\git-for-windows\bin\bash --login -i" -new_console:d:%USERPROFILE%"/>
|
||||
<value name="Cmd2" type="string" data="%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe"/>
|
||||
<value name="Active" type="dword" data="00000000"/>
|
||||
<value name="Count" type="dword" data="00000001"/>
|
||||
</key>
|
||||
</key>
|
||||
|
||||
<key name="Apps" modified="2015-01-21 23:28:29" build="140707">
|
||||
<key name="Apps" modified="2015-05-17 22:10:27" build="150513">
|
||||
<value name="Count" type="dword" data="00000000"/>
|
||||
</key>
|
||||
<key name="Colors" modified="2015-01-21 23:28:29" build="140707">
|
||||
<key name="Palette1" modified="2015-01-21 23:28:29" build="140707">
|
||||
<key name="Colors" modified="2015-05-17 22:10:27" build="150513">
|
||||
<key name="Palette1" modified="2015-05-17 22:10:27" build="150513">
|
||||
<value name="Name" type="string" data="Monokai"/>
|
||||
<value name="ExtendColors" type="hex" data="00"/>
|
||||
<value name="ExtendColorIdx" type="hex" data="0e"/>
|
||||
@ -610,6 +613,199 @@
|
||||
<value name="StatusBar.Hide.Time" type="hex" data="01"/>
|
||||
<value name="TaskbarProgress" type="hex" data="01"/>
|
||||
<value name="RetardInactivePanes" type="hex" data="00"/>
|
||||
<value name="ProcessCmdStart" type="hex" data="01"/>
|
||||
<value name="Multi.ShowSearch" type="hex" data="01"/>
|
||||
<value name="Multi.CloseConfirmFlags" type="hex" data="04"/>
|
||||
<value name="FontUseDpi" type="hex" data="01"/>
|
||||
<value name="FontUseUnits" type="hex" data="00"/>
|
||||
<value name="UseScrollLock" type="hex" data="01"/>
|
||||
<value name="CTS.ForceLocale" type="dword" data="00000000"/>
|
||||
<value name="StatusBar.Hide.VisL" type="hex" data="01"/>
|
||||
<value name="StatusBar.Hide.KeyHooks" type="hex" data="01"/>
|
||||
<value name="StatusBar.Hide.WVBack" type="hex" data="01"/>
|
||||
<value name="StatusBar.Hide.WVDC" type="hex" data="01"/>
|
||||
<value name="StatusBar.Hide.Zoom" type="hex" data="01"/>
|
||||
<value name="StatusBar.Hide.Dpi" type="hex" data="01"/>
|
||||
<value name="TabFlashChanged" type="dword" data="00000008"/>
|
||||
<value name="TabModifiedSuffix" type="string" data="[*]"/>
|
||||
<key name="HotKeys" modified="2015-05-17 22:10:27" build="150513">
|
||||
<value name="KeyMacroVersion" type="hex" data="02"/>
|
||||
<value name="Multi.Modifier" type="dword" data="00000011"/>
|
||||
<value name="Multi.ArrowsModifier" type="dword" data="0000005b"/>
|
||||
<value name="MinimizeRestore" type="dword" data="000011c0"/>
|
||||
<value name="MinimizeRestore2" type="dword" data="00000000"/>
|
||||
<value name="GlobalRestore" type="dword" data="00000000"/>
|
||||
<value name="CdExplorerPath" type="dword" data="00000000"/>
|
||||
<value name="ForcedFullScreen" type="dword" data="12115b0d"/>
|
||||
<value name="SwitchGuiFocus" type="dword" data="00000000"/>
|
||||
<value name="SetFocusGui" type="dword" data="00000000"/>
|
||||
<value name="SetFocusChild" type="dword" data="00000000"/>
|
||||
<value name="ChildSystemMenu" type="dword" data="000011ff"/>
|
||||
<value name="Multi.NewConsole" type="dword" data="00000000"/>
|
||||
<value name="Multi.NewConsoleShift" type="dword" data="00001154"/>
|
||||
<value name="Multi.CmdKey" type="dword" data="00000000"/>
|
||||
<value name="Multi.NewWindow" type="dword" data="00000000"/>
|
||||
<value name="Multi.NewConsolePopup" type="dword" data="00000000"/>
|
||||
<value name="Multi.NewConsolePopup2" type="dword" data="00000000"/>
|
||||
<value name="Multi.NewAttach" type="dword" data="00000000"/>
|
||||
<value name="Multi.NewSplitV" type="dword" data="00000000"/>
|
||||
<value name="Multi.NewSplitH" type="dword" data="00000000"/>
|
||||
<value name="Multi.SplitMaximize" type="dword" data="00005d0d"/>
|
||||
<value name="Multi.SplitSizeVU" type="dword" data="00105d26"/>
|
||||
<value name="Multi.SplitSizeVD" type="dword" data="00105d28"/>
|
||||
<value name="Multi.SplitSizeHL" type="dword" data="00105d25"/>
|
||||
<value name="Multi.SplitSizeHR" type="dword" data="00105d27"/>
|
||||
<value name="Key.TabPane1" type="dword" data="00000000"/>
|
||||
<value name="Key.TabPane2" type="dword" data="00000000"/>
|
||||
<value name="Multi.SplitFocusU" type="dword" data="00005d26"/>
|
||||
<value name="Multi.SplitFocusD" type="dword" data="00005d28"/>
|
||||
<value name="Multi.SplitFocusL" type="dword" data="00005d25"/>
|
||||
<value name="Multi.SplitFocusR" type="dword" data="00005d27"/>
|
||||
<value name="Multi.Next" type="dword" data="00000000"/>
|
||||
<value name="Multi.NextShift" type="dword" data="00000000"/>
|
||||
<value name="Multi.Recreate" type="dword" data="00000000"/>
|
||||
<value name="Multi.AltCon" type="dword" data="00000000"/>
|
||||
<value name="Multi.Pause" type="dword" data="80808013"/>
|
||||
<value name="Multi.Scroll" type="dword" data="00000000"/>
|
||||
<value name="Multi.GroupInput" type="dword" data="00005d47"/>
|
||||
<value name="Multi.Detach" type="dword" data="00000000"/>
|
||||
<value name="Multi.Close" type="dword" data="00001157"/>
|
||||
<value name="CloseTabKey" type="dword" data="00000000"/>
|
||||
<value name="CloseGroupKey" type="dword" data="00000000"/>
|
||||
<value name="CloseGroupPrcKey" type="dword" data="00000000"/>
|
||||
<value name="CloseAllConKey" type="dword" data="00000000"/>
|
||||
<value name="CloseZombiesKey" type="dword" data="00000000"/>
|
||||
<value name="CloseExceptConKey" type="dword" data="00000000"/>
|
||||
<value name="KillProcessKey" type="dword" data="00000000"/>
|
||||
<value name="KillAllButShellKey" type="dword" data="00105b2e"/>
|
||||
<value name="DuplicateRootKey" type="dword" data="00000000"/>
|
||||
<value name="CloseConEmuKey" type="dword" data="00001273"/>
|
||||
<value name="Multi.Rename" type="dword" data="00000000"/>
|
||||
<value name="AffinityPriorityKey" type="dword" data="00005d41"/>
|
||||
<value name="Multi.MoveLeft" type="dword" data="00125b25"/>
|
||||
<value name="Multi.MoveRight" type="dword" data="00125b27"/>
|
||||
<value name="CTS.VkBlockStart" type="dword" data="00000000"/>
|
||||
<value name="CTS.VkTextStart" type="dword" data="00000000"/>
|
||||
<value name="CTS.VkCopyFmt0" type="dword" data="00001143"/>
|
||||
<value name="CTS.VkCopyFmt1" type="dword" data="00101143"/>
|
||||
<value name="CTS.VkCopyFmt2" type="dword" data="00000000"/>
|
||||
<value name="CTS.VkCopyAll" type="dword" data="00000000"/>
|
||||
<value name="HighlightMouseSwitch" type="dword" data="00005d4c"/>
|
||||
<value name="HighlightMouseSwitchX" type="dword" data="00005d58"/>
|
||||
<value name="Multi.ShowTabsList" type="dword" data="00000000"/>
|
||||
<value name="Multi.ShowTabsList2" type="dword" data="00000000"/>
|
||||
<value name="ClipboardVkAllLines" type="dword" data="0000102d"/>
|
||||
<value name="ClipboardVkFirstLine" type="dword" data="00001156"/>
|
||||
<value name="DeleteWordToLeft" type="dword" data="00001108"/>
|
||||
<value name="FindTextKey" type="dword" data="00005d46"/>
|
||||
<value name="ScreenshotKey" type="dword" data="00000000"/>
|
||||
<value name="ScreenshotFullKey" type="dword" data="00000000"/>
|
||||
<value name="ShowStatusBarKey" type="dword" data="00000000"/>
|
||||
<value name="ShowTabBarKey" type="dword" data="00000000"/>
|
||||
<value name="ShowCaptionKey" type="dword" data="00000000"/>
|
||||
<value name="AlwaysOnTopKey" type="dword" data="00000000"/>
|
||||
<value name="TransparencyInc" type="dword" data="00000000"/>
|
||||
<value name="TransparencyDec" type="dword" data="00000000"/>
|
||||
<value name="Key.TabMenu" type="dword" data="00000000"/>
|
||||
<value name="Key.TabMenu2" type="dword" data="00000000"/>
|
||||
<value name="Key.Maximize" type="dword" data="00000000"/>
|
||||
<value name="Key.MaximizeWidth" type="dword" data="00000000"/>
|
||||
<value name="Key.MaximizeHeight" type="dword" data="00000000"/>
|
||||
<value name="Key.TileToLeft" type="dword" data="00000000"/>
|
||||
<value name="Key.TileToRight" type="dword" data="00000000"/>
|
||||
<value name="Key.JumpPrevMonitor" type="dword" data="00000000"/>
|
||||
<value name="Key.JumpNextMonitor" type="dword" data="00000000"/>
|
||||
<value name="Key.FullScreen" type="dword" data="0000120d"/>
|
||||
<value name="Key.SysMenu" type="dword" data="00000000"/>
|
||||
<value name="Key.SysMenu2" type="dword" data="00001102"/>
|
||||
<value name="Key.BufUp" type="dword" data="00001126"/>
|
||||
<value name="Key.BufDn" type="dword" data="00001128"/>
|
||||
<value name="Key.BufPgUp" type="dword" data="00001121"/>
|
||||
<value name="Key.BufPgDn" type="dword" data="00001122"/>
|
||||
<value name="Key.BufHfPgUp" type="dword" data="00005d21"/>
|
||||
<value name="Key.BufHfPgDn" type="dword" data="00005d22"/>
|
||||
<value name="Key.BufTop" type="dword" data="00005d24"/>
|
||||
<value name="Key.BufBottom" type="dword" data="00005d23"/>
|
||||
<value name="Key.BufCursor" type="dword" data="00005d08"/>
|
||||
<value name="FontLargerKey" type="dword" data="00000000"/>
|
||||
<value name="FontSmallerKey" type="dword" data="00000000"/>
|
||||
<value name="FontOriginalKey" type="dword" data="00001104"/>
|
||||
<value name="PasteFileKey" type="dword" data="00101146"/>
|
||||
<value name="PastePathKey" type="dword" data="00101144"/>
|
||||
<value name="PasteCygwinKey" type="dword" data="00005d2d"/>
|
||||
<value name="KeyMacro01" type="dword" data="00a01231"/>
|
||||
<value name="KeyMacro01.Text" type="string" data="Task(1)"/>
|
||||
<value name="KeyMacro02" type="dword" data="00a01232"/>
|
||||
<value name="KeyMacro02.Text" type="string" data="Task(2)"/>
|
||||
<value name="KeyMacro03" type="dword" data="000011d0"/>
|
||||
<value name="KeyMacro03.Text" type="string" data="FontSetSize(1,2)"/>
|
||||
<value name="KeyMacro04" type="dword" data="000011d1"/>
|
||||
<value name="KeyMacro04.Text" type="string" data="FontSetSize(1,-2)"/>
|
||||
<value name="KeyMacro05" type="dword" data="00a01233"/>
|
||||
<value name="KeyMacro05.Text" type="string" data="Task(3)"/>
|
||||
<value name="KeyMacro06" type="dword" data="00a01234"/>
|
||||
<value name="KeyMacro06.Text" type="string" data="Task(4)"/>
|
||||
<value name="KeyMacro07" type="dword" data="00a01235"/>
|
||||
<value name="KeyMacro07.Text" type="string" data="Task(5)"/>
|
||||
<value name="KeyMacro08" type="dword" data="00a01236"/>
|
||||
<value name="KeyMacro08.Text" type="string" data="Task(6)"/>
|
||||
<value name="KeyMacro09" type="dword" data="00a01237"/>
|
||||
<value name="KeyMacro09.Text" type="string" data="Task(7)"/>
|
||||
<value name="KeyMacro10" type="dword" data="00a01238"/>
|
||||
<value name="KeyMacro10.Text" type="string" data="Task(8)"/>
|
||||
<value name="KeyMacro11" type="dword" data="00a01239"/>
|
||||
<value name="KeyMacro11.Text" type="string" data="Task(9)"/>
|
||||
<value name="KeyMacro12" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro12.Text" type="string" data=""/>
|
||||
<value name="KeyMacro13" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro13.Text" type="string" data=""/>
|
||||
<value name="KeyMacro14" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro14.Text" type="string" data=""/>
|
||||
<value name="KeyMacro15" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro15.Text" type="string" data=""/>
|
||||
<value name="KeyMacro16" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro16.Text" type="string" data=""/>
|
||||
<value name="KeyMacro17" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro17.Text" type="string" data=""/>
|
||||
<value name="KeyMacro18" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro18.Text" type="string" data=""/>
|
||||
<value name="KeyMacro19" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro19.Text" type="string" data=""/>
|
||||
<value name="KeyMacro20" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro20.Text" type="string" data=""/>
|
||||
<value name="KeyMacro21" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro21.Text" type="string" data=""/>
|
||||
<value name="KeyMacro22" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro22.Text" type="string" data=""/>
|
||||
<value name="KeyMacro23" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro23.Text" type="string" data=""/>
|
||||
<value name="KeyMacro24" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro24.Text" type="string" data=""/>
|
||||
<value name="KeyMacro25" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro25.Text" type="string" data=""/>
|
||||
<value name="KeyMacro26" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro26.Text" type="string" data=""/>
|
||||
<value name="KeyMacro27" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro27.Text" type="string" data=""/>
|
||||
<value name="KeyMacro28" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro28.Text" type="string" data=""/>
|
||||
<value name="KeyMacro29" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro29.Text" type="string" data=""/>
|
||||
<value name="KeyMacro30" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro30.Text" type="string" data=""/>
|
||||
<value name="KeyMacro31" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro31.Text" type="string" data=""/>
|
||||
<value name="KeyMacro32" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro32.Text" type="string" data=""/>
|
||||
<value name="CTS.VkBlock" type="hex" data="a4"/>
|
||||
<value name="CTS.VkText" type="hex" data="a0"/>
|
||||
<value name="CTS.VkAct" type="hex" data="00"/>
|
||||
<value name="CTS.VkPrompt" type="hex" data="00"/>
|
||||
<value name="FarGotoEditorVk" type="hex" data="a2"/>
|
||||
<value name="DndLKey" type="hex" data="00"/>
|
||||
<value name="DndRKey" type="hex" data="a2"/>
|
||||
<value name="WndDragKey" type="dword" data="00121101"/>
|
||||
</key>
|
||||
</key>
|
||||
</key>
|
||||
</key>
|
||||
|
184
config/cmder.lua
Normal file
184
config/cmder.lua
Normal file
@ -0,0 +1,184 @@
|
||||
function lambda_prompt_filter()
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{lamb}", "λ")
|
||||
end
|
||||
|
||||
---
|
||||
-- Resolves closest directory location for specified directory.
|
||||
-- Navigates subsequently up one level and tries to find specified directory
|
||||
-- @param {string} path Path to directory will be checked. If not provided
|
||||
-- current directory will be used
|
||||
-- @param {string} dirname Directory name to search for
|
||||
-- @return {string} Path to specified directory or nil if such dir not found
|
||||
local function get_dir_contains(path, dirname)
|
||||
|
||||
-- return parent path for specified entry (either file or directory)
|
||||
local function pathname(path)
|
||||
local prefix = ""
|
||||
local i = path:find("[\\/:][^\\/:]*$")
|
||||
if i then
|
||||
prefix = path:sub(1, i-1)
|
||||
end
|
||||
return prefix
|
||||
end
|
||||
|
||||
-- Navigates up one level
|
||||
local function up_one_level(path)
|
||||
if path == nil then path = '.' end
|
||||
if path == '.' then path = clink.get_cwd() end
|
||||
return pathname(path)
|
||||
end
|
||||
|
||||
-- Checks if provided directory contains git directory
|
||||
local function has_specified_dir(path, specified_dir)
|
||||
if path == nil then path = '.' end
|
||||
local found_dirs = clink.find_dirs(path..'/'..specified_dir)
|
||||
if #found_dirs > 0 then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Set default path to current directory
|
||||
if path == nil then path = '.' end
|
||||
|
||||
-- If we're already have .git directory here, then return current path
|
||||
if has_specified_dir(path, dirname) then
|
||||
return path..'/'..dirname
|
||||
else
|
||||
-- Otherwise go up one level and make a recursive call
|
||||
local parent_path = up_one_level(path)
|
||||
if parent_path == path then
|
||||
return nil
|
||||
else
|
||||
return get_dir_contains(parent_path, dirname)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function get_hg_dir(path)
|
||||
return get_dir_contains(path, '.hg')
|
||||
end
|
||||
|
||||
local function get_git_dir(path)
|
||||
return get_dir_contains(path, '.git')
|
||||
end
|
||||
|
||||
---
|
||||
-- Find out current branch
|
||||
-- @return {false|mercurial branch name}
|
||||
---
|
||||
function get_hg_branch()
|
||||
for line in io.popen("hg branch 2>nul"):lines() do
|
||||
local m = line:match("(.+)$")
|
||||
if m then
|
||||
return m
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
---
|
||||
-- Get the status of working dir
|
||||
-- @return {bool}
|
||||
---
|
||||
function get_hg_status()
|
||||
for line in io.popen("hg status"):lines() do
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function hg_prompt_filter()
|
||||
|
||||
-- Colors for mercurial status
|
||||
local colors = {
|
||||
clean = "\x1b[1;37;40m",
|
||||
dirty = "\x1b[31;1m",
|
||||
}
|
||||
|
||||
if get_hg_dir() then
|
||||
-- if we're inside of mercurial repo then try to detect current branch
|
||||
local branch = get_hg_branch()
|
||||
if branch then
|
||||
-- Has branch => therefore it is a mercurial folder, now figure out status
|
||||
if get_hg_status() then
|
||||
color = colors.clean
|
||||
else
|
||||
color = colors.dirty
|
||||
end
|
||||
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", color.."("..branch..")")
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- No mercurial present or not in mercurial file
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", "")
|
||||
return false
|
||||
end
|
||||
|
||||
---
|
||||
-- Find out current branch
|
||||
-- @return {false|git branch name}
|
||||
---
|
||||
function get_git_branch()
|
||||
for line in io.popen("git branch 2>nul"):lines() do
|
||||
local m = line:match("%* (.+)$")
|
||||
if m then
|
||||
return m
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
---
|
||||
-- Get the status of working dir
|
||||
-- @return {bool}
|
||||
---
|
||||
function get_git_status()
|
||||
return os.execute("git diff --quiet --ignore-submodules HEAD 2>nul")
|
||||
end
|
||||
|
||||
function git_prompt_filter()
|
||||
|
||||
-- Colors for git status
|
||||
local colors = {
|
||||
clean = "\x1b[1;37;40m",
|
||||
dirty = "\x1b[31;1m",
|
||||
}
|
||||
|
||||
if get_git_dir() then
|
||||
-- if we're inside of git repo then try to detect current branch
|
||||
local branch = get_git_branch()
|
||||
if branch then
|
||||
-- Has branch => therefore it is a git folder, now figure out status
|
||||
if get_git_status() then
|
||||
color = colors.clean
|
||||
else
|
||||
color = colors.dirty
|
||||
end
|
||||
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..branch..")")
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- No git present or not in git file
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", "")
|
||||
return false
|
||||
end
|
||||
|
||||
clink.prompt.register_filter(lambda_prompt_filter, 40)
|
||||
clink.prompt.register_filter(hg_prompt_filter, 50)
|
||||
clink.prompt.register_filter(git_prompt_filter, 50)
|
||||
|
||||
local completions_dir = clink.get_env('CMDER_ROOT')..'/vendor/clink-completions/'
|
||||
for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
|
||||
-- Skip files that starts with _. This could be useful if some files should be ignored
|
||||
if not string.match(lua_module, '^_.*') then
|
||||
local filename = completions_dir..lua_module
|
||||
-- use dofile instead of require because require caches loaded modules
|
||||
-- so config reloading using Alt-Q won't reload updated modules.
|
||||
dofile(filename)
|
||||
end
|
||||
end
|
@ -1,51 +0,0 @@
|
||||
---
|
||||
-- Find out current branch
|
||||
-- @return {false|git branch name}
|
||||
---
|
||||
function get_git_branch()
|
||||
for line in io.popen("git branch 2>nul"):lines() do
|
||||
local m = line:match("%* (.+)$")
|
||||
if m then
|
||||
return m
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
---
|
||||
-- Get the status of working dir
|
||||
-- @return {bool}
|
||||
---
|
||||
function get_git_status()
|
||||
return os.execute("git diff --quiet --ignore-submodules HEAD")
|
||||
end
|
||||
|
||||
function git_prompt_filter()
|
||||
|
||||
-- Colors for git status
|
||||
local colors = {
|
||||
clean = "\x1b[1;37;40m",
|
||||
dirty = "\x1b[31;1m",
|
||||
}
|
||||
|
||||
local branch = get_git_branch()
|
||||
if branch then
|
||||
-- Has branch => therefore it is a git folder, now figure out status
|
||||
if get_git_status() then
|
||||
color = colors.clean
|
||||
else
|
||||
color = colors.dirty
|
||||
end
|
||||
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..branch..")")
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", "")
|
||||
return true
|
||||
end
|
||||
|
||||
-- No git present or not in git file
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", "")
|
||||
return false
|
||||
end
|
||||
|
||||
clink.prompt.register_filter(git_prompt_filter, 50)
|
@ -1,54 +0,0 @@
|
||||
---
|
||||
-- Find out current branch
|
||||
-- @return {false|mercurial branch name}
|
||||
---
|
||||
function get_hg_branch()
|
||||
for line in io.popen("hg branch 2>nul"):lines() do
|
||||
local m = line:match("(.+)$")
|
||||
if m then
|
||||
return m
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
---
|
||||
-- Get the status of working dir
|
||||
-- @return {bool}
|
||||
---
|
||||
function get_hg_status()
|
||||
for line in io.popen("hg status"):lines() do
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function hg_prompt_filter()
|
||||
|
||||
-- Colors for mercurial status
|
||||
local colors = {
|
||||
clean = "\x1b[1;37;40m",
|
||||
dirty = "\x1b[31;1m",
|
||||
}
|
||||
|
||||
local branch = get_hg_branch()
|
||||
if branch then
|
||||
-- Has branch => therefore it is a mercurial folder, now figure out status
|
||||
if get_hg_status() then
|
||||
color = colors.clean
|
||||
else
|
||||
color = colors.dirty
|
||||
end
|
||||
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", color.."("..branch..")")
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", "")
|
||||
return true
|
||||
end
|
||||
|
||||
-- No mercurial present or not in mercurial file
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", "")
|
||||
return false
|
||||
end
|
||||
|
||||
clink.prompt.register_filter(hg_prompt_filter, 50)
|
@ -1,5 +0,0 @@
|
||||
function lambda_prompt_filter()
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{lamb}", "λ")
|
||||
end
|
||||
|
||||
clink.prompt.register_filter(lambda_prompt_filter, 40)
|
@ -27,7 +27,7 @@ match_colour = -1
|
||||
# the line. 0 = PATH only, 1 = PATH and CWD, 2 = PATH, CWD, and directories. In
|
||||
# all cases both executables and directories are matched when there is a path
|
||||
# separator present.
|
||||
exec_match_style = -1
|
||||
exec_match_style = 2
|
||||
|
||||
# name: Prompt colour
|
||||
# type: int
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2013 for Windows Desktop
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmderLauncher", "CmderLauncher.vcxproj", "{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}"
|
||||
EndProject
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@ -19,13 +19,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@ -72,6 +72,7 @@
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@ -84,7 +85,9 @@
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="src\Resource.rc" />
|
||||
<ResourceCompile Include="src\Resource.rc">
|
||||
<FileType>RC</FileType>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\resource.h" />
|
||||
|
@ -79,6 +79,19 @@ optpair GetOption()
|
||||
return pair;
|
||||
}
|
||||
|
||||
bool FileExists(const wchar_t * filePath)
|
||||
{
|
||||
HANDLE hFile = CreateFile(filePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
|
||||
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void StartCmder(std::wstring path, bool is_single_mode)
|
||||
{
|
||||
#if USE_TASKBAR_API
|
||||
@ -87,6 +100,7 @@ void StartCmder(std::wstring path, bool is_single_mode)
|
||||
wchar_t exeDir[MAX_PATH] = { 0 };
|
||||
wchar_t icoPath[MAX_PATH] = { 0 };
|
||||
wchar_t cfgPath[MAX_PATH] = { 0 };
|
||||
wchar_t oldCfgPath[MAX_PATH] = { 0 };
|
||||
wchar_t conEmuPath[MAX_PATH] = { 0 };
|
||||
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
|
||||
|
||||
@ -99,20 +113,42 @@ void StartCmder(std::wstring path, bool is_single_mode)
|
||||
PathRemoveFileSpec(exeDir);
|
||||
|
||||
PathCombine(icoPath, exeDir, L"icons\\cmder.ico");
|
||||
PathCombine(cfgPath, exeDir, L"config\\ConEmu-%COMPUTERNAME%.xml");
|
||||
|
||||
// Check for machine-specific config file.
|
||||
PathCombine(oldCfgPath, exeDir, L"config\\ConEmu-%COMPUTERNAME%.xml");
|
||||
ExpandEnvironmentStrings(oldCfgPath, oldCfgPath, sizeof(oldCfgPath) / sizeof(oldCfgPath[0]));
|
||||
if (!PathFileExists(oldCfgPath)) {
|
||||
PathCombine(oldCfgPath, exeDir, L"config\\ConEmu.xml");
|
||||
}
|
||||
|
||||
// Check for machine-specific config file.
|
||||
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu-%COMPUTERNAME%.xml");
|
||||
ExpandEnvironmentStrings(cfgPath, cfgPath, sizeof(cfgPath) / sizeof(cfgPath[0]));
|
||||
if (!PathFileExists(cfgPath)) {
|
||||
PathCombine(cfgPath, exeDir, L"config\\ConEmu.xml");
|
||||
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");
|
||||
}
|
||||
|
||||
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe");
|
||||
|
||||
if (FileExists(oldCfgPath) && !FileExists(cfgPath))
|
||||
{
|
||||
if (!CopyFile(oldCfgPath, cfgPath, FALSE))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy ConEmu.xml file to new location! Restart cmder as administrator."
|
||||
: L"Failed to copy ConEmu.xml file to new location!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_single_mode)
|
||||
{
|
||||
swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
|
||||
swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder", icoPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf_s(args, L"/Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
|
||||
swprintf_s(args, L"/Icon \"%s\" /Title Cmder", icoPath);
|
||||
}
|
||||
|
||||
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
|
||||
|
BIN
msvcp120.dll
BIN
msvcp120.dll
Binary file not shown.
BIN
msvcr120.dll
BIN
msvcr120.dll
Binary file not shown.
@ -4,6 +4,15 @@ launcher
|
||||
.git
|
||||
*.rb
|
||||
build
|
||||
scripts
|
||||
config\.history
|
||||
packignore
|
||||
icons\Thumbs.db
|
||||
icons\cmder_icon.psd
|
||||
icons\icon_16.png
|
||||
icons\icon_32.png
|
||||
icons\icon_48.png
|
||||
icons\icon_256.png
|
||||
Cmder.bat
|
||||
vendor\tmp
|
||||
appveyor.yml
|
||||
|
@ -11,11 +11,11 @@
|
||||
.EXAMPLE
|
||||
.\build.ps1
|
||||
|
||||
Executes the default build for cmder; Conemu, clink. This is equivalent to the "minimum" style package in the releases
|
||||
Executes the default build for Cmder; Conemu, clink. This is equivalent to the "minimum" style package in the releases
|
||||
.EXAMPLE
|
||||
.\build.ps1 -Full
|
||||
.\build.ps1 -Compile
|
||||
|
||||
Executes a full build for cmder, including git. This is equivalent to the "full" style package in the releases
|
||||
Recompile the launcher executable if you have the requisite build tools for C++ installed.
|
||||
.EXAMPLE
|
||||
.\build -verbose
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
Samuel Vasko, Jack Bennett
|
||||
Part of the Cmder project.
|
||||
.LINK
|
||||
https://github.com/bliker/cmder - Project Home
|
||||
http://cmder.net/ - Project Home
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess=$true)]
|
||||
Param(
|
||||
@ -46,8 +46,11 @@ Param(
|
||||
# Launcher folder location
|
||||
[string]$launcher = "..\launcher",
|
||||
|
||||
# Include git with the package build
|
||||
[switch]$Full,
|
||||
# Config folder location
|
||||
[string]$config = "..\config",
|
||||
|
||||
# New launcher if you have MSBuild tools installed
|
||||
[switch]$Compile
|
||||
)
|
||||
|
||||
. "$PSScriptRoot\utils.ps1"
|
||||
@ -59,31 +62,52 @@ $sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json
|
||||
# Check for requirements
|
||||
Ensure-Exists $sourcesPath
|
||||
Ensure-Executable "7z"
|
||||
New-Item -Type Directory -Path (Join-Path $saveTo "/tmp/") -ErrorAction SilentlyContinue >$null
|
||||
|
||||
# Preserve modified (by user) ConEmu setting file
|
||||
if ($config -ne "") {
|
||||
$ConEmuXml = Join-Path $saveTo "conemu-maximus5\ConEmu.xml"
|
||||
if (Test-Path $ConEmuXml -pathType leaf) {
|
||||
$ConEmuXmlSave = Join-Path $config "ConEmu.xml"
|
||||
Write-Verbose "Backup '$ConEmuXml' to '$ConEmuXmlSave'"
|
||||
Copy-Item $ConEmuXml $ConEmuXmlSave
|
||||
} else { $ConEmuXml = "" }
|
||||
} else { $ConEmuXml = "" }
|
||||
|
||||
$vend = $pwd
|
||||
foreach ($s in $sources) {
|
||||
if($Full -eq $false -and $s.name -eq "msysgit"){
|
||||
Continue
|
||||
}
|
||||
|
||||
Write-Verbose "Getting $($s.name) from URL $($s.url)"
|
||||
|
||||
# We do not care about the extensions/type of archive
|
||||
$tempArchive = "$($s.name).tmp"
|
||||
$tempArchive = "tmp/$($s.name).tmp"
|
||||
Delete-Existing $tempArchive
|
||||
Delete-Existing $s.name
|
||||
|
||||
Invoke-WebRequest -Uri $s.url -OutFile $tempArchive -ErrorAction Stop
|
||||
Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop
|
||||
Extract-Archive $tempArchive $s.name
|
||||
|
||||
if ((Get-Childitem $s.name).Count -eq 1) {
|
||||
Flatten-Directory($s.name)
|
||||
}
|
||||
# Write current version to .cmderver file, for later.
|
||||
"$($s.version)" | Out-File "$($s.name)/.cmderver"
|
||||
}
|
||||
|
||||
# Restore user configuration
|
||||
if ($ConEmuXml -ne "") {
|
||||
Write-Verbose "Restore '$ConEmuXmlSave' to '$ConEmuXml'"
|
||||
Copy-Item $ConEmuXmlSave $ConEmuXml
|
||||
}
|
||||
|
||||
Pop-Location
|
||||
|
||||
Push-Location -Path $launcher
|
||||
msbuild CmderLauncher.vcxproj /p:configuration=Release
|
||||
Pop-Location
|
||||
if($Compile) {
|
||||
Push-Location -Path $launcher
|
||||
msbuild CmderLauncher.vcxproj /p:configuration=Release
|
||||
Pop-Location
|
||||
} else {
|
||||
Write-Warning "You are not building a launcher, Use -Compile"
|
||||
Write-Warning "This cannot be a release. Test build only!"
|
||||
}
|
||||
|
||||
Write-Verbose "All good and done!"
|
||||
|
@ -16,10 +16,10 @@
|
||||
Creates default archives for cmder with plenty of information
|
||||
.NOTES
|
||||
AUTHORS
|
||||
Samuel Vasko, Jack Bennett
|
||||
Samuel Vasko, Jack Bennett, Martin Kemp
|
||||
Part of the Cmder project.
|
||||
.LINK
|
||||
https://github.com/bliker/cmder - Project Home
|
||||
https://github.com/cmderdev/cmder - Project Home
|
||||
#>
|
||||
|
||||
[CmdletBinding(SupportsShouldProcess=$true)]
|
||||
@ -42,10 +42,11 @@ Ensure-Executable "7z"
|
||||
$targets = @{
|
||||
"cmder.zip" = $null;
|
||||
"cmder.7z" = $null;
|
||||
"cmder_mini.zip" = "-x!`"vendor\msysgit`"";
|
||||
"cmder_mini.zip" = "-x!`"vendor\git-for-windows`"";
|
||||
}
|
||||
|
||||
Delete-Existing "..\Version*"
|
||||
Delete-Existing "..\build\*"
|
||||
|
||||
$version = Invoke-Expression "git describe --abbrev=0 --tags"
|
||||
(New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null
|
||||
|
@ -28,7 +28,7 @@ function Delete-Existing ($path) {
|
||||
}
|
||||
|
||||
function Extract-Archive ($source, $target) {
|
||||
Invoke-Expression "7z x -y -o$($target) $source > `$null"
|
||||
Invoke-Expression "7z x -y -o$($target) '$source' > `$null"
|
||||
if ($lastexitcode -ne 0) {
|
||||
Write-Error "Extracting of $source failied"
|
||||
}
|
||||
@ -54,5 +54,51 @@ function Flatten-Directory ($name) {
|
||||
}
|
||||
|
||||
function Digest-MD5 ($path) {
|
||||
if(Get-Command Get-FileHash -ErrorAction SilentlyContinue){
|
||||
return (Get-FileHash -Algorithm MD5 -Path $path).Hash
|
||||
}
|
||||
|
||||
return Invoke-Expression "md5sum $path"
|
||||
}
|
||||
|
||||
function Register-Cmder(){
|
||||
[CmdletBinding()]
|
||||
Param
|
||||
(
|
||||
# Text for the context menu item.
|
||||
$MenuText = "Cmder Here"
|
||||
|
||||
, # Defaults to the current cmder directory when run from cmder.
|
||||
$PathToExe = (Join-Path $env:CMDER_ROOT "cmder.exe")
|
||||
|
||||
, # Commands the context menu will execute.
|
||||
$Command = "%V"
|
||||
|
||||
, # Defaults to the icons folder in the cmder package.
|
||||
$icon = (Split-Path $PathToExe | join-path -ChildPath 'icons/cmder.ico')
|
||||
)
|
||||
Begin
|
||||
{
|
||||
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
|
||||
}
|
||||
Process
|
||||
{
|
||||
New-Item -Path "HKCR:\Directory\Shell\Cmder" -Force -Value $MenuText
|
||||
New-ItemProperty -Path "HKCR:\Directory\Shell\Cmder" -Force -Name "Icon" -Value `"$icon`"
|
||||
New-ItemProperty -Path "HKCR:\Directory\Shell\Cmder" -Force -Name "NoWorkingDirectory"
|
||||
New-Item -Path "HKCR:\Directory\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" "
|
||||
}
|
||||
}
|
||||
|
||||
function Download-File {
|
||||
param (
|
||||
$Url,
|
||||
$File
|
||||
)
|
||||
# I think this is the problem
|
||||
$File = $File -Replace "/", "\"
|
||||
Write-Verbose "Downloading from $Url to $File"
|
||||
$wc = new-object System.Net.WebClient
|
||||
$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
|
||||
$wc.DownloadFile($Url, $File)
|
||||
}
|
||||
|
42
vendor/init.bat
vendored
42
vendor/init.bat
vendored
@ -1,10 +1,12 @@
|
||||
:: Init Script for cmd.exe
|
||||
:: Sets some nice defaults
|
||||
:: Created as part of cmder project
|
||||
|
||||
:: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||
:: !!! Use "%CMDER_ROOT%\config\user-startup.cmd" to add your own startup commands
|
||||
|
||||
:: Find root dir
|
||||
@if not defined CMDER_ROOT (
|
||||
for /f %%i in ("%ConEmuDir%\..\..") do @set CMDER_ROOT=%%~fi
|
||||
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do @set CMDER_ROOT=%%~fi
|
||||
)
|
||||
|
||||
:: Change the prompt style
|
||||
@ -21,15 +23,30 @@
|
||||
:: Run clink
|
||||
@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config"
|
||||
|
||||
:: Prepare for msysgit
|
||||
:: Prepare for git-for-windows
|
||||
|
||||
:: I do not even know, copypasted from their .bat
|
||||
@set PLINK_PROTOCOL=ssh
|
||||
@if not defined TERM set TERM=cygwin
|
||||
|
||||
:: Check if msysgit is installed
|
||||
@if exist "%ProgramFiles%\Git" (
|
||||
set "GIT_INSTALL_ROOT=%ProgramFiles%\Git"
|
||||
) else if exist "%ProgramFiles(x86)%\Git" (
|
||||
set "GIT_INSTALL_ROOT=%ProgramFiles(x86)%\Git"
|
||||
) else if exist "%CMDER_ROOT%\vendor" (
|
||||
set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows"
|
||||
)
|
||||
|
||||
:: Add git to the path
|
||||
@if defined GIT_INSTALL_ROOT (
|
||||
set "PATH=%GIT_INSTALL_ROOT%\bin;%GIT_INSTALL_ROOT%\usr\bin;%GIT_INSTALL_ROOT%\usr\share\vim\vim74;%PATH%"
|
||||
:: 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"
|
||||
)
|
||||
|
||||
:: Enhance Path
|
||||
@set git_install_root=%CMDER_ROOT%\vendor\msysgit
|
||||
@set PATH=%CMDER_ROOT%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%git_install_root%\share\vim\vim74;%CMDER_ROOT%;%PATH%
|
||||
@set PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%
|
||||
|
||||
:: Add aliases
|
||||
@doskey /macrofile="%CMDER_ROOT%\config\aliases"
|
||||
@ -45,4 +62,17 @@
|
||||
)
|
||||
)
|
||||
|
||||
:: @call "%CMDER_ROOT%/bin/agent.cmd"
|
||||
@if exist "%CMDER_ROOT%\config\user-startup.cmd" (
|
||||
@rem create this file and place your own command in there
|
||||
call "%CMDER_ROOT%\config\user-startup.cmd"
|
||||
) else (
|
||||
@echo Creating user startup file: "%CMDER_ROOT%\config\user-startup.cmd"
|
||||
(
|
||||
@echo :: use this file to run your own startup commands
|
||||
@echo :: use @ in front of the command to prevent printing the command
|
||||
@echo.
|
||||
@echo :: @call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd
|
||||
@echo :: @set PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%
|
||||
@echo.
|
||||
) > "%CMDER_ROOT%\config\user-startup.cmd"
|
||||
)
|
||||
|
73
vendor/profile.ps1
vendored
73
vendor/profile.ps1
vendored
@ -1,25 +1,54 @@
|
||||
# Global modules directory
|
||||
$global:PsGetDestinationModulePath = $PSScriptRoot + "\..\vendor\psmodules"
|
||||
# Init Script for PowerShell
|
||||
# Created as part of cmder project
|
||||
|
||||
# Push to modules location
|
||||
Push-Location -Path ($PsGetDestinationModulePath)
|
||||
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||
# !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands
|
||||
|
||||
# Load modules from current directory
|
||||
Get-ChildItem -Directory | `
|
||||
Foreach-Object{
|
||||
Import-Module .\$_\$_
|
||||
# Compatibility with PS major versions <= 2
|
||||
if(!$PSScriptRoot) {
|
||||
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
|
||||
}
|
||||
|
||||
# Come back to PWD
|
||||
Pop-Location
|
||||
# Add Cmder modules directory to the autoload path.
|
||||
$CmderModulePath = Join-path $PSScriptRoot "psmodules/"
|
||||
|
||||
if( -not $env:PSModulePath.Contains($CmderModulePath) ){
|
||||
$env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;")
|
||||
}
|
||||
|
||||
try {
|
||||
# Check if git is on PATH, i.e. Git already installed on system
|
||||
Get-command -Name "git" -ErrorAction Stop >$null
|
||||
} catch {
|
||||
$env:Path += ";$env:CMDER_ROOT\vendor\git-for-windows\bin"
|
||||
}
|
||||
|
||||
try {
|
||||
Import-Module -Name "posh-git" -ErrorAction Stop >$null
|
||||
$gitStatus = $true
|
||||
} catch {
|
||||
Write-Warning "Missing git support, install posh-git with 'Install-Module posh-git' and restart cmder."
|
||||
$gitStatus = $false
|
||||
}
|
||||
|
||||
function checkGit($Path) {
|
||||
if (Test-Path -Path (Join-Path $Path '.git/') ) {
|
||||
Write-VcsStatus
|
||||
return
|
||||
}
|
||||
$SplitPath = split-path $path
|
||||
if ($SplitPath) {
|
||||
checkGit($SplitPath)
|
||||
}
|
||||
}
|
||||
|
||||
# Set up a Cmder prompt, adding the git prompt parts inside git repos
|
||||
function global:prompt {
|
||||
$realLASTEXITCODE = $LASTEXITCODE
|
||||
$Host.UI.RawUI.ForegroundColor = "white"
|
||||
Write-Host($pwd.ProviderPath) -NoNewLine -ForegroundColor "green"
|
||||
if (Get-Module posh-git) {
|
||||
Write-VcsStatus
|
||||
$Host.UI.RawUI.ForegroundColor = "White"
|
||||
Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green
|
||||
if($gitStatus){
|
||||
checkGit($pwd.ProviderPath)
|
||||
}
|
||||
$global:LASTEXITCODE = $realLASTEXITCODE
|
||||
Write-Host "`nλ" -NoNewLine -ForegroundColor "DarkGray"
|
||||
@ -27,8 +56,7 @@ function global:prompt {
|
||||
}
|
||||
|
||||
# Load special features come from posh-git
|
||||
if (Get-Module posh-git) {
|
||||
Enable-GitColors
|
||||
if ($gitStatus) {
|
||||
Start-SshAgent -Quiet
|
||||
}
|
||||
|
||||
@ -38,3 +66,16 @@ if (Test-Path Env:\CMDER_START) {
|
||||
} elseif ($Env:CMDER_ROOT -and $Env:CMDER_ROOT.StartsWith($pwd)) {
|
||||
Set-Location -Path $Env:USERPROFILE
|
||||
}
|
||||
|
||||
# Enhance Path
|
||||
$env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT"
|
||||
|
||||
|
||||
$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config/user-profile.ps1"
|
||||
if(Test-Path $CmderUserProfilePath) {
|
||||
# Create this file and place your own command in there.
|
||||
. "$CmderUserProfilePath"
|
||||
} else {
|
||||
Write-Host "Creating user startup file: $CmderUserProfilePath"
|
||||
"# Use this file to run your own startup commands" | Out-File $CmderUserProfilePath
|
||||
}
|
88
vendor/psmodules/PsGet/PsGet.psd1
vendored
88
vendor/psmodules/PsGet/PsGet.psd1
vendored
@ -1,88 +0,0 @@
|
||||
@{
|
||||
# These modules will be processed when the module manifest is loaded. This is only supported in PS 3.0
|
||||
#RootModule = "PsGet.psm1"
|
||||
|
||||
#This is required for PS 2.0
|
||||
ModuleToProcess = "PsGet.psm1"
|
||||
|
||||
# The version of this module.
|
||||
ModuleVersion = '1.0'
|
||||
|
||||
# This GUID is used to uniquely identify this module.
|
||||
GUID = '638FF397-8108-4B94-981A-D9BDAB4774B2'
|
||||
|
||||
# The author of this module.
|
||||
Author = 'Mike Chaliy'
|
||||
|
||||
# The company or vendor for this module.
|
||||
CompanyName = ''
|
||||
|
||||
# The copyright statement for this module.
|
||||
Copyright = '(c) 2013'
|
||||
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'PsGet module for installing PowerShell modules'
|
||||
|
||||
# Minimum version of the Windows PowerShell engine required by this module
|
||||
PowerShellVersion = '2.0'
|
||||
|
||||
# Name of the Windows PowerShell host required by this module
|
||||
# PowerShellHostName = ''
|
||||
|
||||
# Minimum version of the Windows PowerShell host required by this module
|
||||
# PowerShellHostVersion = ''
|
||||
|
||||
# Minimum version of the .NET Framework required by this module
|
||||
DotNetFrameworkVersion = '2.0'
|
||||
|
||||
# Minimum version of the common language runtime (CLR) required by this module
|
||||
CLRVersion = '2.0'
|
||||
|
||||
# Processor architecture (None, X86, Amd64) required by this module
|
||||
ProcessorArchitecture = 'None'
|
||||
|
||||
# Modules that must be imported into the global environment prior to importing this module
|
||||
# RequiredModules = @()
|
||||
|
||||
# Assemblies that must be loaded prior to importing this module
|
||||
# RequiredAssemblies = @()
|
||||
|
||||
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
|
||||
# ScriptsToProcess = @()
|
||||
|
||||
# Type files (.ps1xml) to be loaded when importing this module
|
||||
# TypesToProcess = @()
|
||||
|
||||
# Format files (.ps1xml) to be loaded when importing this module
|
||||
# FormatsToProcess = @()
|
||||
|
||||
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
|
||||
NestedModules = @()
|
||||
|
||||
# Functions to export from this module
|
||||
FunctionsToExport = '*'
|
||||
|
||||
# Cmdlets to export from this module
|
||||
CmdletsToExport = '*'
|
||||
|
||||
# Variables to export from this module
|
||||
VariablesToExport = '*'
|
||||
|
||||
# Aliases to export from this module
|
||||
AliasesToExport = '*'
|
||||
|
||||
# List of all modules packaged with this module.
|
||||
# ModuleList = @()
|
||||
|
||||
# List of all files packaged with this module
|
||||
# FileList = @()
|
||||
|
||||
# Private data to pass to the module specified in RootModule/ModuleToProcess
|
||||
# PrivateData = ''
|
||||
|
||||
# HelpInfo URI of this module
|
||||
# HelpInfoURI = ''
|
||||
|
||||
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
|
||||
# DefaultCommandPrefix = ''
|
||||
}
|
19
vendor/sources.json
vendored
19
vendor/sources.json
vendored
@ -1,17 +1,22 @@
|
||||
[
|
||||
{
|
||||
"name": "msysgit",
|
||||
"version": "1.9.5-preview",
|
||||
"url": "https://github.com/msysgit/msysgit/releases/download/Git-1.9.5-preview20141217/PortableGit-1.9.5-preview20141217.7z"
|
||||
"name": "git-for-windows",
|
||||
"version": "v2.6.2.windows.1",
|
||||
"url": "https://github.com/git-for-windows/git/releases/download/v2.6.2.windows.1/PortableGit-2.6.2-32-bit.7z.exe"
|
||||
},
|
||||
{
|
||||
"name": "clink",
|
||||
"version": "0.4.4",
|
||||
"url": "https://github.com/mridgers/clink/releases/download/0.4.4/clink_0.4.4.zip"
|
||||
"version": "0.4.5",
|
||||
"url": "https://github.com/mridgers/clink/releases/download/0.4.5/clink_0.4.5.zip"
|
||||
},
|
||||
{
|
||||
"name": "conemu-maximus5",
|
||||
"version": "150215",
|
||||
"url": "https://conemu.codeplex.com/downloads/get/1430634"
|
||||
"version": "151025",
|
||||
"url": "https://github.com/Maximus5/ConEmu/releases/download/v15.10.25/ConEmuPack.151025.7z"
|
||||
},
|
||||
{
|
||||
"name": "clink-completions",
|
||||
"version": "0.2.1",
|
||||
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.2.1.zip"
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user