Skip to content

Commit

Permalink
Merge pull request #771 from cmderdev/development
Browse files Browse the repository at this point in the history
Merge latest development
  • Loading branch information
MartiUK committed Feb 8, 2016
2 parents 86edf3c + d97bc4c commit b17db69
Show file tree
Hide file tree
Showing 15 changed files with 376 additions and 115 deletions.
11 changes: 9 additions & 2 deletions Cmder.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
@echo off
SET CMDER_ROOT=%~dp0
if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1%
start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\ConEmu.xml"

:: Remove trailing '\'
@if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1%

if exist "%~1" (
start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%~1"
) else (
start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\ConEmu.xml"
)
62 changes: 56 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,73 @@ In a file explorer window right click in or on a directory to see "Cmder Here" i

## Features

### Access to multiple shells in one window using tabs
You can open multiple tabs each containing one of the following shells:

|Task|Shell|Description|
|----|-----|-----------|
|Cmder|cmd.exe|Windows 'cmd.exe' shell enhanced with Git, Git aware prompt, Clink(GNU Readline), and Aliases.|
|Cmder as Admin|cmd.exe|Administrative Windows 'cmd.exe' Cmder shell.|
|Powershell|powershell.exe|Windows Powershell enhanced with Git and Git aware prompt .|
|Powershell as Admin|powershell.exe|Administrative Windows 'powerhell.exe' Cmder shell.|
|Bash|bash.exe|Unix/Linux like bash shell running on Windows.|
|Bash as Admin|bash.exe|Administrative Unix/Linux like bash shell running on Windows.|
|Mintty|bash.exe|Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences|
|Mintty as Admin|bash.exe|Administrative Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences|

Cmder, Powershell, and Bash tabs all run on top of the Windows Console API and work as you might expect in Cmder with access to use ConEmu's color schemes, key bindings and other settings defined in the ConEmu Settings dialog.

Mintty tabs use a program called 'mintty' as the terminal that is not based on the Windows Console API so some differences in functionality are normal, as a result mintty specific config is done via the '[%USERPROFILE%|$HOME]/.minttyrc' file.

Mintty differs from the other tabs in that it supports xterm/xterm-256color TERM types, and does not work with ConEmu settings like color schemes and key bindings. For more on Mintty and its config click [here](https://code.google.com/p/mintty/).

An example of setting Cmder portable terminal colors for mintty:

From a bash/mintty shell:

```
cd $CMDER_ROOT/vendor
git clone https://github.com/karlin/mintty-colors-solarized.git
cd mintty-colors-solarized/
echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh>>$CMDER_ROOT/config/user-profile.sh
```

### Cmder Portable Shell User Config
User specific configuration is possible using the cmder specific shell config files. Edit the below files to add your own configuration:

|Shell|Cmder Portable User Config|
| ------------- |:-------------:|
|Cmder|%CMDER_ROOT%\config\user-profile.cmd|
|Powershell|$ENV:CMDER_ROOT\config\user-profile.ps1|
|Bash/Mintty|$CMDER_ROOT/config/user-profile.sh|

Note: Bash and Mintty sessions will also source the '$HOME/.bashrc' file it it exists after it sources '$CMDER_ROOT/config/user-profile.sh'.

### Aliases
You can define simple aliases with command `alias name=command`.
#### Cmder(Cmd.exe) Aliases
You can define simple aliases for `cmd.exe` sessions with a command like `alias name=command`. Cmd.exe aliases support optional parameters through the `$1-9` or the `$*` special characters so the alias `vi=vim.exe $*` typed as `vi [filename]` will open `[filename]` in `vim.exe`.

Cmd.exe aliases can also be more complex. See: [DOSKEY.EXE documentation](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/doskey.mspx?mfr=true) for additional details on complex aliases/macros for 'cmd.exe'

Aliases defined using the `alias.bat` command will automatically be saved in the `%CMDER_ROOT%\config\aliases` file

#### Bash.exe|Mintty.exe Aliases
Bash shells support simple and complex aliases with optional parameters natively so they work a little different. Typing `alias name=command` will create an alias only for the current running session. To make an alias permanent add it to either your `$CMDER_ROOT/config/user-profile.sh` or your `$HOME/.bashrc`.

For example there is one defined for you `alias e.=explorer .`
If you add bash aliases to `$CMDER_ROOT/config/user-profile.sh` they will portable and follow your Cmder folder if you copy it to another machine. `$HOME/.bashrc` defined aliases are not portable.

All aliases will be saved in `/config/aliases` file
#### Powershell.exe Aliases
Powershell has native simple alias support, for example `[new-alias | set-alias] alias command`, so complex aliases with optional parameters are not supported in Powershell sessions. Type `get-help [new-alias|set-alias] -full` for help on Powershell aliases.

### 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).
If you want to run SSH agent on startup, include the line `@call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"` in `%CMDER_ROOT%/config/user-profile.cmd` (usually just uncomment it).

## Todo

1. Git Bash
2. Check for clink and git before injecting them (Sort of done)
1. Check for clink and git before injecting them (Sort of done)

## License

Expand Down
103 changes: 77 additions & 26 deletions config/ConEmu.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2015-05-17 22:10:27" build="150513">
<key name=".Vanilla" modified="2015-11-24 14:43:35" build="151119">
<value name="ColorTable00" type="dword" data="00222827"/>
<value name="ColorTable01" type="dword" data="009e5401"/>
<value name="ColorTable02" type="dword" data="0004aa74"/>
Expand Down Expand Up @@ -72,7 +72,7 @@
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{cmd}"/>
<value name="StartTasksName" type="string" data="{cmd::Cmder}"/>
<value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/>
<value name="StoreTaskbarkTasks" type="hex" data="00"/>
Expand Down Expand Up @@ -123,12 +123,12 @@
<value name="ColorKeyTransparent" type="hex" data="00"/>
<value name="ColorKeyValue" type="dword" data="00010101"/>
<value name="UseCurrentSizePos" type="hex" data="01"/>
<value name="WindowMode" type="dword" data="0000051f"/>
<value name="WindowMode" type="dword" data="00000520"/>
<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="000003f8"/>
<value name="ConWnd Y" type="dword" data="00000143"/>
<value name="ConWnd X" type="dword" data="000000c5"/>
<value name="ConWnd Y" type="dword" data="00000089"/>
<value name="16bit Height" type="dword" data="00000000"/>
<value name="AutoSaveSizePos" type="hex" data="00"/>
<value name="IntegralSize" type="hex" data="00"/>
Expand Down Expand Up @@ -483,51 +483,89 @@
<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-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%"/>
<key name="Tasks" modified="2015-11-24 14:43:35" build="151119">
<value name="Count" type="dword" data="00000008"/>
<key name="Task1" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="{cmd::Cmder as Admin}"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&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="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 -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''&quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<key name="Task2" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="{cmd::Cmder}"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&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="Task3" modified="2015-05-17 22:10:27" build="150513">
<value name="Name" type="string" data="{PowerShell as Admin}"/>
<key name="Task3" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="{Powershell::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="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&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}"/>
<key name="Task4" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="{Powershell::Powershell}"/>
<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="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&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="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"/>
<value name="Flags" type="dword" data="00000000"/>
</key>
<key name="Task5" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="{bash::mintty as Admin}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data="/icon &quot;%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico&quot;"/>
<value name="Cmd1" type="string" data="*%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe /bin/bash -l -new_console:d:%USERPROFILE%"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
</key>
<key name="Task6" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="{bash::mintty}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data="/icon &quot;%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico&quot;"/>
<value name="Cmd1" type="string" data="%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe /bin/bash -l -new_console:d:%userProfile%"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
<value name="Cmd2" type="string" data="%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe /bin/bash -l -new_console:d:%userProfile%"/>
</key>
<key name="Task7" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="{bash::bash as Admin}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&quot;"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
<value name="Cmd1" type="string" data="*cmd /c &quot;%ConEmuDir%\..\git-for-windows\bin\bash --login -i&quot; -new_console:d:%USERPROFILE%"/>
</key>
<key name="Task8" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="{bash::bash}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&quot;"/>
<value name="Cmd1" type="string" data="cmd /c &quot;%ConEmuDir%\..\git-for-windows\bin\bash --login -i&quot; -new_console:d:%USERPROFILE%"/>
<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">
<key name="Apps" modified="2015-11-24 14:49:10" build="151119">
<value name="Count" type="dword" data="00000000"/>
</key>
<key name="Colors" modified="2015-05-17 22:10:27" build="150513">
<key name="Palette1" modified="2015-05-17 22:10:27" build="150513">
<key name="Colors" modified="2015-11-24 14:49:10" build="151119">
<key name="Palette1" modified="2015-11-24 14:49:10" build="151119">
<value name="Name" type="string" data="Monokai"/>
<value name="ExtendColors" type="hex" data="00"/>
<value name="ExtendColorIdx" type="hex" data="0e"/>
Expand Down Expand Up @@ -628,7 +666,7 @@
<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">
<key name="HotKeys" modified="2015-11-24 14:43:35" build="151119">
<value name="KeyMacroVersion" type="hex" data="02"/>
<value name="Multi.Modifier" type="dword" data="00000011"/>
<value name="Multi.ArrowsModifier" type="dword" data="0000005b"/>
Expand Down Expand Up @@ -805,7 +843,20 @@
<value name="DndLKey" type="hex" data="00"/>
<value name="DndRKey" type="hex" data="a2"/>
<value name="WndDragKey" type="dword" data="00121101"/>
<value name="Multi.Unfasten" type="dword" data="00000000"/>
<value name="Key.DebugProcess" type="dword" data="00105b44"/>
<value name="Key.DumpProcess" type="dword" data="00000000"/>
<value name="Key.DumpTree" type="dword" data="00000000"/>
</key>
<value name="StartCreateDelay" type="dword" data="00000064"/>
<value name="DefaultTerminalDebugLog" type="hex" data="00"/>
<value name="LastMonitor" type="string" data="0,0,1920,1020"/>
<value name="Restore2ActiveMon" type="hex" data="00"/>
<value name="DownShowExOnTopMessage" type="hex" data="00"/>
<value name="EnvironmentSet" type="multi"/>
<value name="Update.InetTool" type="hex" data="00"/>
<value name="Update.InetToolCmd" type="string" data=""/>
<value name="SuppressBells" type="hex" data="01"/>
</key>
</key>
</key>
13 changes: 12 additions & 1 deletion config/Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## Config

All config files must be in this folder. If there is no option to create or read from this folder directly, it must be hardlinked.
All config files must be in this folder. If there is no option to set this folder
directly, it has to be hardlinked.

* `aliases`: aliases in cmd; called form vendor\init.bat; autocreated from
`vendor\aliases.example`.
* `*.lua`: clink completitions and prompt filters; called from vendor\cmder.lua after all
other prompt filter and clink completitons are initialized; add your own.
* `user_profile.{sh|bat|ps1}: startup files for bash|cmd|powershell tasks; called from their
respective startup scripts in `vendor\`; autocreated on first start of such a task
* `.history`: the current commandline history; autoupdated on close
* `settings`: settings for readline; overwritten on update
* `ConEmu.xml`: settings from ConEmu (=the UI of cmder -> Preferences); overwritten on update
43 changes: 0 additions & 43 deletions config/settings

This file was deleted.

Loading

0 comments on commit b17db69

Please sign in to comment.