Merge remote-tracking branch 'upstream/development' into development

Conflicts:
	bin/alias.bat
This commit is contained in:
Mike Sigsworth 2015-10-12 21:32:33 -06:00
commit c46eb6a525
24 changed files with 688 additions and 296 deletions

2
.gitignore vendored
View File

@ -8,5 +8,7 @@ vendor/*/*
config/.history
Thumbs.db
*.exe
*.dll
build/
Version v*
*.bak

38
CONTRIBUTING.md Normal file
View 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/)

BIN
Cmder.exe

Binary file not shown.

View File

@ -1,54 +1,51 @@
# Cmder
Latest release is **[v1.1.4.1](https://github.com/bliker/cmder/releases/tag/v1.1.4.1)**
[![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)
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 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, adds a Monokai color scheme, integrates amazing [clink](https://github.com/mridgers/clink) 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 **Dropbox**. 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, 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
1. Extract
1. (optional) Place files into `bin` folder, it will be injected into your PATH.
1. Run cmder
*(There will be a version with installer)*
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;
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`*
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.
*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
* <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
* `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
* <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)
@ -63,17 +60,14 @@ All aliases will be saved in `/config/aliases` file
### SSH Agent
To start SSH agent simply call `agent`, which is in the `bin` folder.
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, uncomment the line in `/vendor/init.bat`so it says `@call "%CMDER_ROOT%/bin/agent.cmd"`.
If you want to run SSH agent on startup, uncomment the line in `/vendor/init.bat`so it says `@call "%GIT_INSTALL_ROOT%/cmd/start-ssh-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
1. Git Bash
2. Check for clink and git before injecting them (Sort of done)
## License
@ -81,7 +75,7 @@ All software included is bundled with own license
The MIT License (MIT)
Copyright (c) 2013 Samuel Vasko
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

View File

@ -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

View File

@ -12,7 +12,11 @@ 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
:: if arg is an existing alias, display it
if ["%2"] == [""] (
doskey /macros | findstr /b %1= && goto:eof
echo Insufficient parameters. & goto:p_help
)
:: validate alias
for /f "delims== tokens=1" %%G in ("%_x%") do set alias=%%G

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2014-01-21 18:36:36" build="131215">
<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"/>
@ -349,7 +349,7 @@
<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="006b2d288000000"/>
<value name="ChildSystemMenu" type="dword" data="ffffffff"/>
<value name="Multi.NewConsole" type="dword" data="80808000"/>
<value name="Multi.NewConsoleShift" type="dword" data="00001154"/>
<value name="Multi.NewConsolePopup" type="dword" data="80808000"/>
@ -419,7 +419,7 @@
<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="0012a032"/>
<value name="KeyMacro05" type="dword" data="0012a033"/>
<value name="KeyMacro05.Text" type="string" data="Task(&quot;PowerShell as Admin&quot;)"/>
<value name="KeyMacro06" type="dword" data="00000000"/>
<value name="KeyMacro06.Text" type="string" data=""/>
@ -483,38 +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="2014-01-21 18:36:36" build="131215">
<value name="Count" type="dword" data="00000002"/>
<key name="Task1" modified="2014-01-21 18:36:36" build="131215">
<key name="Tasks" modified="2015-05-17 22:10:27" build="150513">
<value name="Count" type="dword" data="00000003"/>
<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 &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="cmd /k &quot;%ConEmuDir%\..\init.bat&quot; -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="2014-01-21 18:36:36" build="131215">
<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 &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="PowerShell -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''&quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''&quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<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="2014-09-17 09:17:41" build="140903">
<value name="Name" type="string" data="{PowerShell as Admin}"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data="/icon &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="* PowerShell -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\custom.ps1''' &quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
</key>
</key>
<key name="Apps" modified="2014-01-21 18:36:36" build="131215">
<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 &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''&quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<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 &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="cmd /k &quot;%ConEmuDir%\..\init.bat &amp; %CMDER_ROOT%\vendor\git-for-windows\bin\bash --login -i&quot; -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-05-17 22:10:27" build="150513">
<value name="Count" type="dword" data="00000000"/>
</key>
<key name="Colors" modified="2014-01-21 18:36:36" build="131215">
<key name="Palette1" modified="2014-01-21 18:36:36" build="131215">
<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"/>
@ -589,6 +602,210 @@
<value name="TransparencyDec" type="dword" data="00000000"/>
<value name="Key.MaximizeWidth" type="dword" data="00000000"/>
<value name="Key.MaximizeHeight" type="dword" data="00000000"/>
<value name="DefaultTerminalAgressive" type="hex" data="01"/>
<value name="DefaultTerminalNewWindow" type="hex" data="00"/>
<value name="AnsiLog" type="hex" data="00"/>
<value name="AnsiLogPath" type="string" data="%ConEmuDir%\Logs\"/>
<value name="Multi.DupConfirm" type="hex" data="01"/>
<value name="Multi.DetachConfirm" type="hex" data="01"/>
<value name="CTS.Intelligent" type="hex" data="01"/>
<value name="CTS.IntelligentExceptions" type="string" data="far|vim.exe"/>
<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(&quot;cmd&quot;)"/>
<value name="KeyMacro02" type="dword" data="00a01232"/>
<value name="KeyMacro02.Text" type="string" data="Task(&quot;PowerShell&quot;)"/>
<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(&quot;PowerShell as Admin&quot;)"/>
<value name="KeyMacro06" type="dword" data="00000000"/>
<value name="KeyMacro06.Text" type="string" data=""/>
<value name="KeyMacro07" type="dword" data="00000000"/>
<value name="KeyMacro07.Text" type="string" data=""/>
<value name="KeyMacro08" type="dword" data="00000000"/>
<value name="KeyMacro08.Text" type="string" data=""/>
<value name="KeyMacro09" type="dword" data="00000000"/>
<value name="KeyMacro09.Text" type="string" data=""/>
<value name="KeyMacro10" type="dword" data="00000000"/>
<value name="KeyMacro10.Text" type="string" data=""/>
<value name="KeyMacro11" type="dword" data="00000000"/>
<value name="KeyMacro11.Text" type="string" data=""/>
<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>

View File

@ -1,6 +1,6 @@
e.=explorer .
gl=git log --oneline --all --graph --decorate $*
ls=ls --color $*
ls=ls --show-control-chars -F --color $*
pwd=cd
clear=cls
history=cat %CMDER_ROOT%\config\.history

184
config/cmder.lua Normal file
View 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

View File

@ -1,50 +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..")")
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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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" />

View File

@ -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,16 +113,29 @@ void StartCmder(std::wstring path, bool is_single_mode)
PathRemoveFileSpec(exeDir);
PathCombine(icoPath, exeDir, L"icons\\cmder.ico");
PathCombine(cfgPath, exeDir, L"config\\ConEmu.xml");
PathCombine(oldCfgPath, 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);

Binary file not shown.

Binary file not shown.

View File

@ -11,7 +11,11 @@
.EXAMPLE
.\build.ps1
Executes the default build for cmder, 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
Executes a full build for Cmder, including git. This is equivalent to the "full" style package in the releases
.EXAMPLE
.\build -verbose
@ -27,7 +31,6 @@
.LINK
https://github.com/bliker/cmder - Project Home
#>
[CmdletBinding(SupportsShouldProcess=$true)]
Param(
# CmdletBinding will give us;
@ -41,7 +44,13 @@ Param(
[string]$saveTo = "..\vendor\",
# Launcher folder location
[string]$launcher = "..\launcher"
[string]$launcher = "..\launcher",
# Config folder location
[string]$config = "..\config",
# Include git with the package build
[switch]$Full
)
. "$PSScriptRoot\utils.ps1"
@ -53,12 +62,28 @@ $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 = "" }
foreach ($s in $sources) {
if($Full -eq $false -and $s.name -eq "git-for-windows"){
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
@ -68,6 +93,14 @@ foreach ($s in $sources) {
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

View File

@ -16,7 +16,7 @@
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
@ -42,7 +42,7 @@ 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*"

View File

@ -13,7 +13,7 @@ function Ensure-Executable ($command) {
set-alias -Name "7z" -Value "$env:programfiles\7-zip\7z.exe" -Scope script
}
ElseIf( ($command -eq "7z") -and (Test-Path "$env:programw6432\7-zip\7z.exe") ) {
set-alias -Name "7z" -Value "$env:programw6432\7-zip\7z.exe" -Scope script
set-alias -Name "7z" -Value "$env:programw6432\7-zip\7z.exe" -Scope script
}
Else {
Write-Error "Missing $command! Ensure it is installed and on in the PATH"
@ -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,38 @@ 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`" "
}
}

27
vendor/init.bat vendored
View File

@ -4,12 +4,12 @@
:: 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
:: Mmm tasty lamb
@prompt $E[1;32;40m$P$S{git}$S$_$E[1;30;40m{lamb}$S$E[0m
@prompt $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m
:: Pick right version of clink
@if "%PROCESSOR_ARCHITECTURE%"=="x86" (
@ -21,15 +21,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%\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 +60,4 @@
)
)
:: @call "%CMDER_ROOT%/bin/agent.cmd"
:: @call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"

64
vendor/profile.ps1 vendored
View File

@ -1,33 +1,56 @@
# Global modules directory
$global:PsGetDestinationModulePath = $PSScriptRoot + "\..\vendor\psmodules"
# Push to modules location
Push-Location -Path ($PsGetDestinationModulePath)
# 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
return "`nλ "
Write-Host "`nλ" -NoNewLine -ForegroundColor "DarkGray"
return " "
}
# Load special features come from posh-git
if (Get-Module posh-git) {
Enable-GitColors
if ($gitStatus) {
Start-SshAgent -Quiet
}
@ -37,3 +60,6 @@ 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"

View File

@ -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
View File

@ -1,17 +1,22 @@
[
{
"name": "msysgit",
"version": "1.9.4-preview",
"url": "https://github.com/msysgit/msysgit/releases/download/Git-1.9.4-preview20140929/PortableGit-1.9.4-preview20140929.7z"
"name": "git-for-windows",
"version": "v2.6.1.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.6.1.windows.1/PortableGit-2.6.1-32-bit.7z.exe"
},
{
"name": "clink",
"version": "0.4.3",
"url": "https://github.com/mridgers/clink/releases/download/0.4.3/clink_0.4.3.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": "141117",
"url": "https://conemu.codeplex.com/downloads/get/932416"
"version": "150913",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v15.09.13/ConEmuPack.150913.7z"
},
{
"name": "clink-completions",
"version": "0.2.0",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.2.0.zip"
}
]