Compare commits

...

189 Commits

Author SHA1 Message Date
4651201b6c Merge branch 'master' of https://github.com/bliker/cmder 2015-05-17 22:26:31 +01:00
3966ed9433 Merge branch 'development' 2015-05-17 22:25:08 +01:00
2383777418 Merge conflict 2015-05-17 22:24:38 +01:00
a18320c938 Improve warning text when posh-git is missing. 2015-05-17 22:13:23 +01:00
83a853bd52 Fix build script. 2015-05-17 22:13:04 +01:00
53efab127e Update to VS2015. 2015-05-17 22:12:49 +01:00
4de72b68dd Update ConEmu.xml for latest update. 2015-05-17 22:11:10 +01:00
f196375f53 Update to latest ConEmu. 2015-05-17 22:08:35 +01:00
7217d5c536 Merge pull request #451 from MartiUK/development
Update sources.json
2015-04-02 13:03:22 +01:00
e549f88b00 Removed extra quotation mark 2015-04-02 12:02:34 +01:00
687fb72397 Update sources for 1.2
Updated sources.
2015-04-02 12:00:44 +01:00
aaf70a4d9f Run PowerShell as default 2015-03-25 15:11:35 +00:00
717b9f990e Write vendor version to .cmderver file
For a future feature.
2015-03-25 15:09:23 +00:00
4f0e51c6a8 Merge pull request #441 from Jackbennett/ps-register-cmder
Helper function using powershell to register the cmder context menu
2015-03-25 15:08:14 +00:00
520e7cfc0d Merge pull request #440 from Jackbennett/proper-git-check
git and Posh-git check
2015-03-25 15:07:51 +00:00
84dc9c5f0c Helper function using powershell to register the cmder context menu
Function must be run as an administrator since we're touching the
registry.

A neat by product is that users can now re-run this command and set custom
icons.

I'm not sure what the `%V` command does but it's not opening in the targeted
folder as yet.

The output is a little ugly at rpesent.
2015-03-25 14:34:25 +00:00
c466698d6b Only write VCS Status if we're in a git repo
In an effort to speed up the prompt we will only call write-vcsstatus if
there is a .git folder in the current or any parent path recursively.

As this function is called every new prompt line it needs to be as fast as
possible.
2015-03-25 12:29:10 +00:00
18fc5e37c7 Check that git can really be used as well as posh-git
Explicitly call `import posh-git` because it doesn't have a module
manifest thus powershell can't autoload it when using a cmdlet.

At present the cmder repo doesn't try to download posh-git so it might be
missing from the users session.
2015-03-25 12:22:07 +00:00
2292348f95 Merge pull request #438 from vladimir-kotikov/development
Improves performance of prompt filtering
2015-03-22 02:46:52 +00:00
2855a699a1 Removes error messages when getting repo status
When `get_git_status` fails the inner `os.execute` call print error
message to console. This removes all error messages fro such cases.
2015-03-22 00:42:40 +03:00
d8c9d32cb2 Improve performance of git and mercurial prompt
This implements custom logic to detect if we're inside of working tree
and skips os calls if not. This will improve performance of prompt
handling, especially for mercurial prompt.
2015-03-22 00:42:40 +03:00
522a75835f Merge pull request #434 from vladimir-kotikov/development
Preview PR for including external completions into Cmder
2015-03-20 21:38:06 +00:00
b75b3239e7 Adds clink-completions as an external dependency
* Adds package to sources.json
* Merges all cmder's lua modules into one -> cmder.lua to exclude future conflicts
* Adds external modules loading logic
2015-03-20 22:29:34 +03:00
69eb956d65 Merge pull request #432 from Jackbennett/ps-revert-newline
Revert new line from commit dc834cc28f
2015-03-18 21:14:39 +00:00
6c074693a4 Merge pull request #431 from Jackbennett/ps-profile-modulePath
Leverage the Module Autoload path and save doing it ourselves.
2015-03-18 21:14:20 +00:00
dfa58acccc Revert new line from commit dc834cc28f
This matches how cmd looks in conemu for cmder and PS seems to add some
padding around command output so I really don't see what the extra new
line is doing.

Saving dat precious vertical space.
2015-03-18 15:47:01 +00:00
e811c60ab2 Leverage the Module Autoload path and save doing it ourselves.
This should be faster too as we won't automatically import all functions
to the session. Powershell now knows where to look before declaring they
don't exist.
2015-03-18 15:33:55 +00:00
004761b32f Delete all except git.exe, reducing final size
Using git-$COMMAND is no longer supported anyway.
2015-03-18 14:55:50 +00:00
8b8f98c078 Merge pull request #429 from Jackbennett/mend-build
Fix build script removing a trailing comma. Download into a temp folder.
2015-03-18 14:54:55 +00:00
58a89e779b Merge pull request #430 from Jackbennett/native-ps
Adds support for PS 4.0 native hash command to remove a dependency
2015-03-18 14:54:31 +00:00
aad729eb87 Adds support for PS 4.0 native hash command to remove a dependency
PS 4.0 requires installing WMF 4.0 on windows 7, 8, Server 2012
Native on 8.1, Server 2012r2
2015-03-18 13:50:00 +00:00
2c184f8721 Fix build script removing a traling comma. Download into a temp folder.
I made a bad patch with the parameters syntax. I'm making the temp files
go into a subfolder as if the build script stop theres a .tmp that could
be accidentially tracked by source control.
2015-03-18 13:21:43 +00:00
3c289b455b Initial git cleanup PS
It's not functional, yet.
2015-03-18 12:28:34 +00:00
66d5170514 Remove unnecessary binaries.
Just remember to add them in to the package.
2015-03-18 11:12:30 +00:00
b25e46d7a7 Merge pull request #364 from narnaud/pr-local-git
Prefer user installed git over cmder one.
2015-03-18 11:00:44 +00:00
60d3c67194 Merge pull request #324 from cgrail/patch-2
Border less window mode
2015-03-18 10:57:55 +00:00
34947c4f0f Fix the /d flag
Was deleted in last commit.
2015-03-18 10:56:25 +00:00
3b637e9866 Merge branch 'glucas-alias-show' into development 2015-03-18 10:54:44 +00:00
efe244b5fa Resolved conflict in alias.bat merge 2015-03-18 10:54:22 +00:00
aa9cb38672 Change clink matching style to default. Fixes #218
Users should change this to their preference, this is reverting it to
how it should be "out of the box".
2015-03-18 10:37:08 +00:00
7169f49fff Merge pull request #311 from sescandell/fix-adminlaunch
FIX CMDER_ROOT for admin launch
2015-03-18 10:35:15 +00:00
021263d81c Merge pull request #273 from LeoColomb/master
Fixes small Powershell' loader issues
2015-03-18 10:33:58 +00:00
5dbb84d78b Build XP Compatible Binaries
Because people still use an operating system from 2001.
2015-03-18 10:16:40 +00:00
c0dcce4880 Merge pull request #422 from ragekit/development
Added git shell task.
2015-03-16 12:14:23 +00:00
4b2590bfd3 Added git shell task. 2015-03-15 14:00:46 +01:00
df4e83de43 Merge pull request #410 from Jackbennett/patch-1
Install steps clarity
2015-02-26 16:51:12 +00:00
4a681bbc60 Install steps clarity
In reference to #389 I thought I'd just clear up this instruction even more.
2015-02-26 11:01:10 +00:00
1ae1194555 Merge pull request #406 from Jackbennett/development
Use a -Full parameter to download all sources rather than the minimum
2015-02-25 16:38:15 +00:00
e566589871 Merge pull request #407 from Jackbennett/update-sources
Update Conemu <preview release>, update clink 4.4
2015-02-25 16:35:50 +00:00
a0d87e8368 Update Conemu <preview realease>, update clink
Lets move to the much newer ConEmu preview release.
Pulling the newer clink also
2015-02-25 15:14:33 +00:00
31c169a761 Use a -Full parameter to download all sources rather than the minimum
Use a full switch to indicate if we want to go and pull a copy of git
since its huge and if a developer is cloning the repo to work on and needs
to build it they already have git.
2015-02-25 13:58:11 +00:00
af30a90ef0 Merge pull request #401 from utek/hg_prompt
Adding mercuial prompt
2015-02-24 12:49:25 +00:00
8a885167c3 mercurial prompt 2015-02-23 13:23:39 +01:00
8275f005b2 Added 2 to 2013
We aren't living in the past.
2015-02-19 10:37:43 +00:00
b216079966 Merge pull request #390 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2015-02-12 10:34:13 +00:00
c3d1ccba79 Added Gitter badge 2015-02-12 10:31:44 +00:00
7834fe0a26 Merge pull request #378 from asika32764/patch-2
Support UTF-8 file list
2015-01-28 17:46:43 +00:00
64aaa96bfb Support UTF-8 file list 2015-01-29 00:57:17 +08:00
a708fff824 Merge pull request #374 from CumpsD/patch-1
Updated vendor references
2015-01-21 23:44:16 +00:00
f78e24094b Merge pull request #308 from SheGe/feature/psprompt
Lambda color in powershell was changed to DarkGray
2015-01-21 23:41:00 +00:00
d3e85417ce Update ConEmu.xml
Fixes missing 'PowerShell as Admin' Task
2015-01-21 23:40:09 +00:00
33810f993f Change PowerShell as admin macro
'PowerShell' and 'PowerShell as Admin' task were conflicting as the same
macro `Ctrl + Alt + 2` but the 'As Admin' task is set to `Ctrl + Alt +
3`
2015-01-21 23:24:10 +00:00
ed7a20cec2 Updated vendor references
- Upgrade to git is needed for a security issue in 1.9.4
- Upgrade of ConEmu is needed for High DPI support
2015-01-21 22:25:01 +01:00
45ff72b48b Prefer user installed git over cmder one.
Also set SVN_SSH (pointing to git ssh) so we can use git svn on
ssh svn repositories.
2015-01-12 22:17:30 +01:00
f5ce49b8b3 Merge pull request #353 from Celeo/master
Updating to msysgit 1.9.5
2015-01-08 22:09:52 +00:00
17b4525e60 Merge pull request #362 from vladimir-kotikov/clink-update
Update clink to latest (0.4.3) version
2015-01-08 22:09:20 +00:00
6c69536295 Merge pull request #358 from vladimir-kotikov/alias-rework
Rework `alias` command to not to use external tools
2015-01-08 22:08:11 +00:00
b831c4569f Updates clink to latest (0.4.3) version 2015-01-09 00:29:57 +03:00
dba00b9175 Adds info about command options 2015-01-08 20:43:45 +03:00
01849c3365 Fix quotation for aliases variable 2014-12-24 22:24:54 +03:00
30ddd53288 alias command without arguments now outputs all defined aliases 2014-12-24 22:24:47 +03:00
0ae09e9a4a Add /d option to alias command that removes existing alias
* Remove separate unalias script and add `unalias` alias ^) for `alias /d`
2014-12-24 22:24:42 +03:00
e224d133f3 Rework alias command to handle duplicates
* Removed unnecessary perl script
2014-12-24 22:24:35 +03:00
503ddcb895 Updating to msysgit 1.9.5
https://github.com/blog/1938-vulnerability-announced-update-your-git-clients

Updating to msysgit 1.9.5
2014-12-19 19:41:55 -08:00
11753fdd2a Merge pull request #352 from ogrim/sshagent
Adding script to enable SSH-agent #193
2014-12-18 11:42:10 +00:00
ad4a2103ea Support %HOME% variables containing spaces 2014-12-18 10:30:14 +01:00
6106a555fe Adding info on SSH agent to README.md 2014-12-17 19:15:54 +01:00
75707f9a65 Adding script to enable SSH-agent #193
Adding agent-script to bin-folder and a commented out call in init.bat
2014-12-17 14:32:40 +01:00
dc834cc28f Fixes Powershell loader issues
* Fix modules order required
* Add newline before prompt
* Fix color name
2014-12-01 20:40:07 +01:00
bbbda146b8 Merge pull request #326 from kohenkatz/development
changes copied from PR#256
2014-11-21 10:48:13 +00:00
e5531537ad changes copied from 0f295234cc and 18fea0ac03 2014-11-20 11:08:37 -05:00
44e6184487 Update msysgit & conemu
Updated links to latest versions of msysgit and conemu; 1.9.4-preview20140929 and 141117 respectively.
2014-11-20 11:29:03 +00:00
57ec099e0f Border less window mode
Copy of the https://github.com/bliker/cmder/pull/320

Now for the development branch.

Disable ugly grey windows borders. Especially beautiful for the Quake mode.
2014-11-19 11:34:01 -08:00
b700016a15 Merge pull request #313 from glucas/unalias-command
Add an unalias command
2014-11-11 17:54:47 +00:00
469d299ae8 Update alias.bat to show an existing alias
When calling alias.bat with a single argument, check if that argument is
an existing alias and if so, display it.

Otherwise, proceed as before.
2014-11-11 12:13:31 -05:00
79fbae0854 Add an unalias command
Add bin/unalias.bat to perform the opposite action of alias.bat.
Removes a given alias from the current shell environment and the
aliases file.

Fixes issue #281.
2014-11-11 10:40:57 -05:00
f4bca30e11 Merge pull request #312 from bliker/revert-256-master
Revert "Add single mode support."
2014-11-06 11:48:37 +00:00
b067d48f6c Revert "Add single mode support." 2014-11-06 11:48:00 +00:00
188305426f Merge pull request #256 from TheCjw/master
Add single mode support.
2014-11-06 11:28:11 +00:00
ea3863bc6b FIX CMDER_ROOT for admin launch
When launching a cmd in admin mode, if %ConEmuDir%\..\.. contains any space, it breaks the scripts.
Thanks to this patch, the path is correctly defined now.
2014-11-04 12:26:25 +01:00
c8193ea368 Lambda color in powershell was changed to DarkGray 2014-10-29 21:27:30 +01:00
25991ac6a1 Merge pull request #304 from glucas/pull-alias-reload
Add option to reload aliases from file
2014-10-25 21:40:49 +01:00
717b556d7a Add option to reload aliases from file
Add a quick way to reload the aliases file in the current shell using:

    alias /reload
2014-10-24 15:39:37 -04:00
20c9ba207d Merge pull request #300 from melku/clean_aliases_script
Clean aliases script
2014-10-23 21:20:38 +01:00
d6edd152ad Merge pull request #299 from robgithub/development
Adding history alias
2014-10-23 20:35:55 +01:00
Rob
6a241b5e7c Adding history alias
simple alias that operates as history command
2014-10-23 18:59:58 +01:00
373e1ef36d Merge pull request #298 from LeoColomb/patch-1
Fixes the ambiguity about notice and parameter
2014-10-23 17:48:54 +01:00
5b91665040 Fixes ambigius about notice and parameter 2014-10-23 18:45:54 +02:00
e95127268e Don't ignore icons when packing (Fixes #292)
Icons were being ignored and causing the `/REGISTER ALL *` command to
give the context menu option a broken image..
2014-10-23 10:38:36 +01:00
1067ca0fc6 Create the contributing file.
Something for potential contributors.
2014-10-23 10:15:43 +01:00
9c29adfe68 Merge pull request #296 from brunobatista/patch-1
Fixed small issue in README
2014-10-23 09:51:15 +01:00
312fec2550 Fixed small issue in README 2014-10-22 23:24:13 -02:00
247c65ef05 Add an error message if an alias is detected as invalid 2014-10-16 01:09:24 -04:00
45c9742ea5 remove lua version 2014-10-16 01:03:19 -04:00
5bd0c29c25 Convert the clean alias script to perl 2014-10-16 01:00:59 -04:00
1e2f954724 Add a lua script to clean the aliases file
Note that cmder doesn't ship with lua. Next step is converting this
script to perl, which ships with msysgit.
2014-10-16 00:20:36 -04:00
f5eb662783 Delete PsGet.psd1 2014-09-17 15:02:31 +02:00
e363139b30 Merge pull request #271 from LeoColomb/master
Add custom loader for Powershell & improve its implementation
2014-09-17 12:04:40 +01:00
0e5f070347 Merge pull request #272 from bliker/master
Update Dev Branch
2014-09-17 12:03:54 +01:00
98350e14e8 Add custom loader for Powershell, improve its implementation in Cmder
Fixes #104, fixes #53, fixes #65 (my bad), related to #136, and should
fix #139
2014-09-17 09:55:15 +02:00
18fea0ac03 Update prompt text 2014-09-04 23:41:39 +08:00
0f295234cc Adding single mode support. 2014-09-04 23:29:51 +08:00
dcc9f5e59a Merge pull request #253 from bliker/revert-243-fix-home
Revert "Start in the HOME folder."
2014-09-02 16:24:13 +01:00
73795739f0 Revert "Start in the HOME folder." 2014-09-02 16:22:44 +01:00
67b963b7ee Merge branch 'development' 2014-08-31 12:28:04 +01:00
93589b1c8d 1.1.4.1 launcher build 2014-08-31 12:27:37 +01:00
a6f35d6373 Bump version 2014-08-31 12:16:51 +01:00
bbcabfb730 Merge branch 'development' 2014-08-31 12:03:13 +01:00
75801cbdc8 Merge branch '1.1.4.1' into development 2014-08-31 12:01:51 +01:00
9822fa844e Ignore version files.
Version files don't need to be tracked.
2014-08-30 16:47:21 +01:00
a9f5d552bc Reintroduce VS2013 dlls.
Fixes #246.
2014-08-30 16:46:22 +01:00
63120b8998 Merge pull request #243 from narnaud/fix-home
Start in the HOME folder.
2014-08-28 15:02:37 +01:00
8cdce27653 Merge pull request #249 from narnaud/fix-build
Ensure-Exists is necessary for build.ps1, add it back.
2014-08-28 12:59:32 +01:00
a5691285ec Ensure-Exists is necessary for build.ps1, add it back. 2014-08-28 13:34:59 +02:00
3223a0391a Start in the HOME folder. 2014-08-28 13:09:30 +02:00
a39c632d71 Merge pull request #166 from glucas/run_as_admin
Find cmder files when running as Administrator.
2014-08-27 09:58:14 +01:00
8c6847ee0d Merge branch 'development' 2014-08-27 00:03:47 +01:00
f66f598fca Increment version 2014-08-27 00:03:06 +01:00
de8d2d22f6 Fix the build 2014-08-26 23:52:49 +01:00
72c045dc2d Merge pull request #244 from narnaud/fix-clinkversion
Fix clink version
2014-08-26 12:37:52 +01:00
5ee2fb2a8d Fix clink version 2014-08-26 13:20:38 +02:00
2ba40773b3 Merge pull request #241 from narnaud/fix-vim
The latest msysgit comes with vim 7.4.
2014-08-26 08:51:57 +01:00
662663813e The latest msysgit comes with vim 7.4. 2014-08-26 05:50:07 +02:00
2ec650557e Merge pull request #199 from Jackbennett/docs-integration
New section for user help with an integration feature of Cmder.
2014-08-18 16:09:43 +01:00
932e517c2f Merge pull request #208 from MartiUK/master
Bump versions
2014-08-04 22:13:33 +01:00
6a9d6dd37e bump versions again 2014-08-04 22:13:23 +01:00
e9707b2022 Bump versions 2014-06-19 08:27:44 +01:00
ef91a9c272 New section for user help with an integration feature of Cmder. 2014-05-16 19:37:46 +01:00
9939b1ba7f CMDER_ROOT variable is now also in path
Now you can call cmder /whatever from cmder shell
2014-04-29 15:32:56 +02:00
c032b5f8a0 Using verbose output 2014-04-28 13:22:22 +02:00
9ce90d337b Using earlier version of msvcp and vcr 2014-04-28 13:22:22 +02:00
2a722ee3f3 Remove XP Launcher from TODO list. 2014-04-23 09:29:19 +01:00
3cfd032007 Merge pull request #180 from CoolOppo/patch-1
Update Clink URL
2014-04-14 08:03:47 +01:00
21f0f1dbb2 Update Clink URL
The current Clink URL takes you to the old page on Google
2014-04-13 14:43:05 -04:00
38c13a7f4b Merge branch 'master' of https://github.com/bliker/cmder 2014-04-11 14:31:44 +02:00
97980f5f34 XP compatible launcher 2014-04-11 14:31:16 +02:00
e3e1effef3 Disable click 2014-04-11 14:09:22 +02:00
2542358965 Color scheme from upstream
Before the monokai in the Conemu was different and not matching
colors correctly. Now that was fixed so no need to keep ours.
2014-04-11 14:02:56 +02:00
6b37074dd5 Reordered the PATH, closing #37
Now the msysgit is being loaded first, so find will invoke
the correct and better version
2014-04-11 14:02:34 +02:00
1b7e647b4b Merge pull request #177 from Jackbennett/7zip
Try to find 7-zip if it's installed before an error.
2014-04-11 13:56:32 +02:00
e6618f21a3 Try to find 7-zip if it's installed before an error.
Create an alias to 7z.exe in the script scope.
2014-04-10 18:34:31 +01:00
56a9a2036f Disable left click cursor change by default
Fixes #109
2014-04-10 14:51:03 +02:00
f6c3a0c390 Merge pull request #152 from bliker/scripts
New build and pack scripts
2014-04-10 14:44:39 +02:00
46f6f677dc Silencing the noise 2014-04-10 14:42:20 +02:00
d5d8b0944b Removed old ruby scripts 2014-04-10 13:13:20 +02:00
8e676b3fc7 Added history files 2014-04-10 13:12:38 +02:00
b9379b3ae2 Computing hashes 2014-04-10 13:11:41 +02:00
db49c14422 Fixed paths 2014-04-10 13:11:25 +02:00
46bebee94c More recent package versions 2014-04-10 12:57:45 +02:00
691000fa15 Merge pull request #159 from kohenkatz/fix-context-menu
Add registration for right-click on folder item; Add context-menu icon
2014-04-10 11:45:39 +01:00
df064ec4be Merged 2014-04-10 12:43:34 +02:00
e1c60104ba Updated build and pack Powershell 2014-04-10 12:41:19 +02:00
3a8daf57f7 Merge pull request #167 from schlamar/patch-1
Only cd to $HOME if started in CMDER_ROOT.
2014-03-19 19:50:14 +00:00
fa33052096 Only cd to $HOME if started in CMDER_ROOT. 2014-03-19 12:25:41 +01:00
fe31accba4 Merge pull request #165 from glucas/use_home
Allow for existing HOME variable
2014-03-14 10:23:18 +00:00
3b053f8848 Remove extraneous quotes.
Extra quotes in previous commit caused PATH to be set incorrectly in admin
shell.
2014-03-13 12:36:07 -04:00
c76950293e Find cmder files when running as Administrator.
When starting a shell as Administrator, the CMDER_ROOT variable is
not propagated from the parent (non-Admin) environment.
Fix this by using paths relative to %ConEmuDir%.

Fixes issue #94.
2014-03-13 11:48:50 -04:00
ea22c658b7 CD to HOME by default. 2014-03-11 15:12:35 -04:00
303bfda521 Use HOME if already set. 2014-03-11 15:08:24 -04:00
1f8b0c009a Merge pull request #162 from Jackbennett/scripts
Minor changes for #152
2014-03-05 16:48:01 +01:00
cf74dba780 merging in new additions to the pull request 2014-03-05 14:49:23 +00:00
a9bfd2d2a2 Silencing the output from 7z so I can actually see what else the script is
doing.
Adding some clearer dubugging info for cleaning up folders
2014-03-05 14:00:35 +00:00
b0b8eaef1e Error checking for 7z extraction 2014-03-05 14:31:01 +01:00
5243d8bb8d In powershell you pretty much never want to use Write-Host, its output can't be redirected along the pipeline. You couldn't pipe this output to a logfile. 2014-03-05 13:28:18 +00:00
1225d410fa Merge branch 'scripts' of https://github.com/bliker/cmder into scripts
Conflicts:
	scripts/build.ps1
2014-03-05 12:39:33 +00:00
c661b1f300 Removed unused function 2014-03-05 12:08:26 +00:00
4c1f96c51d Adjusted the build script behavior
Removed some absolute path, and refactored the code so
it handles the nested folder archives
2014-03-05 12:08:24 +00:00
f4b6d8f9a8 Refactored mail download loop, better error handling 2014-03-05 11:22:58 +01:00
0314ee5d46 Removed unused function 2014-03-02 22:04:58 +01:00
6a761a88c1 Adjusted the build script behavior
Removed some absolute path, and refactored the code so
it handles the nested folder archives
2014-03-02 22:00:04 +01:00
447be262f8 A better way to find string length 2014-02-27 18:44:46 -05:00
371ffbc069 Add registration for right-click on folder item; Add context-menu icon
Existing code registered right-click only for blank areas of the
Explorer window.  This change adds a menu item for right-clicking on a
folder in the file list.
Also adds the program's icon to help find it in a crowded context menu.
2014-02-27 18:34:37 -05:00
6d0d93e0fd Merge pull request #157 from Jackbennett/scripts
Getting the build script to a working state
2014-02-26 22:29:31 +01:00
b4a264b1bc This commit amends far more than I would have liked to.
working script will;
Remove existing folders named in the sources
Download the packages listed in sources.json
Extracts the above packages
deletes the downloaded package
2014-02-26 16:46:23 +00:00
3bd0fe517f Need to use an optional package field;
incase url's that don't put the file in the url.
2014-02-26 16:42:48 +00:00
83cd726a41 First sources.json draft 2014-02-24 17:55:34 +01:00
b30056c4b3 First draft of new build script 2014-02-24 17:33:14 +01:00
7688823886 Checking for git and clink 2014-02-18 15:59:44 +01:00
878499cc0b Added bash 2014-02-02 19:08:59 +01:00
27 changed files with 3168 additions and 299 deletions

9
.gitignore vendored
View File

@ -1,9 +1,12 @@
## Those files should be taken from their repositary
vendor/*
!vendor/*.md
!vendor/*.bat
vendor/*/*
!vendor/*
!vendor/psmodules/PsGet
config/.history
Thumbs.db
*.exe
build/
Version v*

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,8 +1,10 @@
# Cmder
Latest release is **[v1.1.3](https://github.com/bliker/cmder/releases/tag/v1.1.3)**
[![Join the chat at https://gitter.im/bliker/cmder](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bliker/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://code.google.com/p/clink/) and custom prompt layout.
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)
@ -14,11 +16,24 @@ The main advantage of Cmder is portability. It is designed to be totally self-co
1. Download the latest release
1. Extract
1. (optional) Place files into `bin` folder, it will be injected into your PATH.
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
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
@ -47,12 +62,19 @@ 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. Launcher XP compatibility.
4. Git Bash
5. Check for clink and git before injecting them
## License
@ -60,7 +82,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

46
bin/agent.cmd Normal file
View File

@ -0,0 +1,46 @@
@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

@ -1,6 +1,18 @@
@echo off
set ALIASES=%CMDER_ROOT%\config\aliases
if ["%*"] == [""] echo Use /? for help & echo. & goto :p_show
if ["%1"] == ["/?"] goto:p_help
if ["%2"] == [""] echo Insufficient parameters. & goto:p_help
if ["%1"] == ["/reload"] goto:p_reload
:: /d flag for delete existing alias
if ["%1"] == ["/d"] goto:p_del %*
:: 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
setlocal
for /f "delims== tokens=1" %%G in ("%*") do set _temp2=%%G
@ -13,15 +25,36 @@ if not ["%_temp%"] == ["%_temp2%"] (
goto:eof
)
echo %* >> "%CMDER_ROOT%\config\aliases"
doskey /macrofile="%CMDER_ROOT%\config\aliases"
echo Alias created
:: replace already defined alias
findstr /b /v /i "%_temp%=" "%ALIASES%" >> "%ALIASES%.tmp"
echo %* >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile="%ALIASES%"
endlocal
goto:eof
:p_del
findstr /b /v /i "%2=" "%ALIASES%" >> "%ALIASES%.tmp"
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile=%ALIASES%
goto:eof
:p_reload
doskey /macrofile="%ALIASES%"
echo Aliases reloaded
goto:eof
:p_show
type "%ALIASES%" || echo No aliases found at "%ALIASES%"
goto :eof
:p_help
echo.Usage:
echo. alias name=full command
echo. alias [/reload] [/d] [name=full command]
echo. /reload Reload the aliases file
echo. /d Delete an alias (must be followed by the alias name)
echo.
echo. If alias is called with any parameters, it will display the list of existing aliases.
echo. In the command, you can use the following notations:
echo. $* allows the alias to assume all the parameters of the supplied command.
echo. $1-$9 Allows you to seperate parameter by number, much like %%1 in batch.
echo. $T is the command seperator, allowing you to string several commands together into one alias.

110
build.rb
View File

@ -1,110 +0,0 @@
# Samuel Vasko 2013
# Cmder build script
# Like really a beta
#
# This script downloads dependencies form google code. Each software is extracted
# in a folder with same name as the project on google code. So Conemu becomes
# conemu-maximus5. Correct files are beeing picked by using labels.
# I will move the script for getting files by labels from php to here as soon I feel like it
require 'fileutils'
require 'open-uri'
require 'uri'
def get_file project, query
urlToFile = URI.escape('http://samuelvasko.tk/gcode/?project='+project+'&query='+query)
open(urlToFile) do |resp|
urlToFile = URI.escape(resp.read.split(/\r?\n/).first)
end
extension = urlToFile.split('.').last
filename = project+'.'+extension
puts "\n ------ Downloading #{project} from #{urlToFile} ------- \n \n"
begin
open(urlToFile, 'rb') do |infile|
open(filename, 'wb') do |outfile|
outfile.write(infile.read)
end
end
rescue IOError => error
puts error
FileUtils.rm(filename) if File.exists?(filename)
exit(1)
end
system("7z x -o\"#{project}\" #{filename}")
File.unlink(project+"."+extension);
# When the folder contains another folder
# that is not what we want
if Dir.glob("#{project}/*").length == 1
temp_name = "#{project}_temp"
FileUtils.mv(project, temp_name)
FileUtils.mv(Dir.glob("#{temp_name}/*")[0], project)
FileUtils.rm_r(temp_name)
end
end
def find_on_path exe
path = ENV['PATH'].split(File::PATH_SEPARATOR)
for dir in path
if File.exists?(File.join(dir, exe))
return true
end
end
return false
end
puts '
______ _ _ _ _ _
| ___ \ (_) | | (_) | |
| |_/ /_ _ _| | __| |_ _ __ __ _ ___ _ __ ___ __| | ___ _ __
| ___ \ | | | | |/ _` | | \'_ \ / _` | / __| \'_ ` _ \ / _` |/ _ \ \'__|
| |_/ / |_| | | | (_| | | | | | (_| | | (__| | | | | | (_| | __/ |
\____/ \__,_|_|_|\__,_|_|_| |_|\__, | \___|_| |_| |_|\__,_|\___|_|
__/ |
|___/
'
unless find_on_path('7z.exe')
puts '7z.exe not found. Ensure 7-zip is installed and on the PATH.'
exit(1)
end
build_exe = true
unless find_on_path('msbuild.exe')
puts 'msbuild.exe not found. We need that to build the executable.'
puts 'Do you want to continue? [Y/n]'
build_exe = false
exit(1) unless gets.chomp.downcase == 'y'
end
puts 'Cleanup'
if Dir.exists?('vendor')
Dir.glob('vendor/*') { |file| FileUtils.rm_rf(file) if File.directory?(file) }
end
Dir.chdir('vendor')
puts 'Getting files'
get_file('clink', 'label:Type-Archive label:Featured')
get_file('conemu-maximus5', 'label:Type-Archive label:Preview label:Featured')
get_file('msysgit', 'label:Type-Archive label:Featured')
puts 'Creating executable'
if build_exe
Dir.chdir('../launcher')
status = system('msbuild /p:Configuration=Release')
unless status
puts 'Looks like the build failied'
exit(1)
end
end
puts 'Done, bye'

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2013-11-29 16:19:40" build="131107">
<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"/>
@ -18,21 +18,21 @@
<value name="ColorTable13" type="dword" data="00b87da8"/>
<value name="ColorTable14" type="dword" data="0081cccc"/>
<value name="ColorTable15" type="dword" data="00ffffff"/>
<value name="ColorTable16" type="dword" data="00000000"/>
<value name="ColorTable17" type="dword" data="00800000"/>
<value name="ColorTable18" type="dword" data="00008000"/>
<value name="ColorTable19" type="dword" data="00808000"/>
<value name="ColorTable20" type="dword" data="00000080"/>
<value name="ColorTable21" type="dword" data="00800080"/>
<value name="ColorTable22" type="dword" data="00008080"/>
<value name="ColorTable23" type="dword" data="00c0c0c0"/>
<value name="ColorTable24" type="dword" data="00808080"/>
<value name="ColorTable25" type="dword" data="00ff0000"/>
<value name="ColorTable26" type="dword" data="0000ff00"/>
<value name="ColorTable27" type="dword" data="00ffff00"/>
<value name="ColorTable28" type="dword" data="000000ff"/>
<value name="ColorTable29" type="dword" data="00ff00ff"/>
<value name="ColorTable30" type="dword" data="0000ffff"/>
<value name="ColorTable16" type="dword" data="00222827"/>
<value name="ColorTable17" type="dword" data="009e5401"/>
<value name="ColorTable18" type="dword" data="0004aa74"/>
<value name="ColorTable19" type="dword" data="00a6831a"/>
<value name="ColorTable20" type="dword" data="003403a7"/>
<value name="ColorTable21" type="dword" data="009c5689"/>
<value name="ColorTable22" type="dword" data="0049b6b6"/>
<value name="ColorTable23" type="dword" data="00cacaca"/>
<value name="ColorTable24" type="dword" data="007c7c7c"/>
<value name="ColorTable25" type="dword" data="00f58303"/>
<value name="ColorTable26" type="dword" data="0006d08d"/>
<value name="ColorTable27" type="dword" data="00e5c258"/>
<value name="ColorTable28" type="dword" data="004b04f3"/>
<value name="ColorTable29" type="dword" data="00b87da8"/>
<value name="ColorTable30" type="dword" data="0081cccc"/>
<value name="ColorTable31" type="dword" data="00ffffff"/>
<value name="ExtendColors" type="hex" data="00"/>
<value name="ExtendColorIdx" type="hex" data="0e"/>
@ -53,7 +53,7 @@
<value name="ClipboardArrowStart" type="hex" data="00"/>
<value name="ClipboardAllLines" type="hex" data="01"/>
<value name="ClipboardFirstLine" type="hex" data="01"/>
<value name="ClipboardClickPromptPosition" type="hex" data="02"/>
<value name="ClipboardClickPromptPosition" type="hex" data="00"/>
<value name="ClipboardDeleteLeftWord" type="hex" data="01"/>
<value name="TrueColorerSupport" type="hex" data="01"/>
<value name="FadeInactive" type="hex" data="01"/>
@ -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="{PowerShell}"/>
<value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/>
<value name="StoreTaskbarkTasks" type="hex" data="00"/>
@ -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="00000000"/>
<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,8 +419,8 @@
<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="00000000"/>
<value name="KeyMacro05.Text" type="string" data=""/>
<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=""/>
<value name="KeyMacro07" type="dword" data="00000000"/>
@ -483,30 +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="2013-11-29 16:19:41" build="131107">
<value name="Count" type="dword" data="00000002"/>
<key name="Task1" modified="2013-11-29 16:19:41" build="131107">
<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;%CMDER_ROOT%\vendor\init.bat&quot; -new_console:d:%USERPROFILE%"/>
<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="2013-11-29 16:19:41" build="131107">
<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="/dir &quot;%userprofile%&quot;"/>
<value name="Cmd1" 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="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}"/>
<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%\..\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\msysgit\bin\bash --login -i&quot; -new_console:d:%USERPROFILE%"/>
<value name="Cmd2" type="string" data="%CMDER_ROOT%\vendor\msysgit\git-bash.bat"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
</key>
</key>
<key name="Apps" modified="2013-11-29 16:19:41" build="131107">
<key name="Apps" modified="2015-05-17 22:10:27" build="150513">
<value name="Count" type="dword" data="00000000"/>
</key>
<key name="Colors" modified="2013-11-29 16:19:41" build="131107">
<key name="Palette1" modified="2013-11-29 16:19:41" build="131107">
<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"/>
@ -573,6 +594,218 @@
<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="ProcessNewConArg" type="hex" data="01"/>
<value name="HighlightMouseRow" type="hex" data="00"/>
<value name="HighlightMouseCol" type="hex" data="00"/>
<value name="HighlightMouseSwitch" type="dword" data="00005d4c"/>
<value name="TransparencyInc" type="dword" data="00000000"/>
<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,5 +1,7 @@
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
unalias=alias /d $1

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 2013
VisualStudioVersion = 12.0.21005.1
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
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>
@ -14,18 +14,19 @@
<ProjectGuid>{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CmderLauncher</RootNamespace>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<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>

View File

@ -12,8 +12,11 @@
#define USE_TASKBAR_API (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define XP (_WIN32_WINNT < _WIN32_WINNT_VISTA)
#define MB_TITLE L"Cmder Launcher"
#define SHELL_MENU_REGISTRY_PATH L"Directory\\Background\\shell\\Cmder"
#define SHELL_MENU_REGISTRY_PATH_BACKGROUND L"Directory\\Background\\shell\\Cmder"
#define SHELL_MENU_REGISTRY_PATH_LISTITEM L"Directory\\shell\\Cmder"
#define streqi(a, b) (_wcsicmp((a), (b)) == 0)
@ -76,7 +79,7 @@ optpair GetOption()
return pair;
}
void StartCmder(std::wstring path)
void StartCmder(std::wstring path, bool is_single_mode)
{
#if USE_TASKBAR_API
wchar_t appId[MAX_PATH] = { 0 };
@ -99,7 +102,14 @@ void StartCmder(std::wstring path)
PathCombine(cfgPath, exeDir, L"config\\ConEmu.xml");
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe");
swprintf_s(args, L"/Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
if (is_single_mode)
{
swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
}
else
{
swprintf_s(args, L"/Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
}
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
SetEnvironmentVariable(L"CMDER_START", path.c_str());
@ -154,30 +164,42 @@ HKEY GetRootKey(std::wstring opt)
return root;
}
void RegisterShellMenu(std::wstring opt)
void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
{
HKEY root = GetRootKey(opt);
HKEY cmderKey;
FAIL_ON_ERROR(
RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL));
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2));
HKEY command;
FAIL_ON_ERROR(
RegCreateKeyEx(cmderKey, L"command", 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &command, NULL));
// First, get the paths we will use
wchar_t exePath[MAX_PATH] = { 0 };
wchar_t icoPath[MAX_PATH] = { 0 };
GetModuleFileName(NULL, exePath, sizeof(exePath));
wchar_t commandStr[MAX_PATH + 20] = { 0 };
swprintf_s(commandStr, L"\"%s\" \"%%V\"", exePath);
// Now that we have `commandStr`, it's OK to change `exePath`...
PathRemoveFileSpec(exePath);
PathCombine(icoPath, exePath, L"icons\\cmder.ico");
// Now set the registry keys
HKEY root = GetRootKey(opt);
HKEY cmderKey;
FAIL_ON_ERROR(
RegCreateKeyEx(root, keyBaseName, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL));
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2));
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"Icon", 0, REG_SZ, (BYTE *)icoPath, wcslen(icoPath) * sizeof(wchar_t)));
HKEY command;
FAIL_ON_ERROR(
RegCreateKeyEx(cmderKey, L"command", 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &command, NULL));
FAIL_ON_ERROR(RegSetValue(command, L"", REG_SZ, commandStr, NULL));
RegCloseKey(command);
@ -185,15 +207,18 @@ void RegisterShellMenu(std::wstring opt)
RegCloseKey(root);
}
void UnregisterShellMenu(std::wstring opt)
void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
{
HKEY root = GetRootKey(opt);
HKEY cmderKey;
FAIL_ON_ERROR(
RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, NULL,
RegCreateKeyEx(root, keyBaseName, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
#if XP
FAIL_ON_ERROR(SHDeleteKey(cmderKey, NULL));
#else
FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL));
FAIL_ON_ERROR(RegDeleteKey(root, SHELL_MENU_REGISTRY_PATH));
#endif
RegCloseKey(cmderKey);
RegCloseKey(root);
}
@ -211,21 +236,27 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
if (streqi(opt.first.c_str(), L"/START"))
{
StartCmder(opt.second);
StartCmder(opt.second, false);
}
else if (streqi(opt.first.c_str(), L"/SINGLE"))
{
StartCmder(opt.second, true);
}
else if (streqi(opt.first.c_str(), L"/REGISTER"))
{
RegisterShellMenu(opt.second);
RegisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_BACKGROUND);
RegisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_LISTITEM);
}
else if (streqi(opt.first.c_str(), L"/UNREGISTER"))
{
UnregisterShellMenu(opt.second);
UnregisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_BACKGROUND);
UnregisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_LISTITEM);
}
else
{
MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n /START <path>\n /REGISTER [USER/ALL]\n /UNREGISTER [USER/ALL]", MB_TITLE, MB_OK);
MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n /START <path>\n /SINGLE <path>\n /REGISTER [USER/ALL]\n /UNREGISTER [USER/ALL]", MB_TITLE, MB_OK);
return 1;
}
return 0;
}
}

Binary file not shown.

Binary file not shown.

40
pack.rb
View File

@ -1,40 +0,0 @@
# Samuel Vasko 2013
# Cmder packing script -- Creates zip files for relase
require "fileutils"
def create_archive name, exclude
if exclude
exclude = " -x!cmder\\" + exclude
else
exclude = ""
end
system('ls')
puts "Running 7z a -x@cmder\\packignore" + exclude + " " + name + " cmder"
system("7z a -x@cmder\\packignore" + exclude + " " + name + " cmder")
end
targets = [
["cmder.zip"],
["cmder.7z"],
["cmder_mini.zip", "vendor\\msysgit"]
]
unless system("git describe --abbrev=0 --tags")
puts "Failied to get the last tag from git, looks like something is missing"
end
version = `git describe --abbrev=0 --tags`
FileUtils.touch('Version ' + version.chomp)
FileUtils.rm('config/.history') if File.exists?('config/.history')
Dir.chdir('..')
targets.each do |ar|
create_archive ar[0], ar[1]
end
Dir.chdir('cmder')
FileUtils.rm('Version ' + version.chomp)

View File

@ -1,8 +1,9 @@
cmder\launcher
cmder\icons
cmder\.gitignore
cmder\.gitattributes
cmder\.git
cmder\*.rb
cmder\packignore
cmder\Cmder.bat
launcher
.gitignore
.gitattributes
.git
*.rb
build
config\.history
packignore
Cmder.bat

92
scripts/build.ps1 Normal file
View File

@ -0,0 +1,92 @@
<#
.Synopsis
Build Cmder
.DESCRIPTION
Use this script to build your own edition of Cmder
This script builds dependencies from current vendor/sources.json file and unpacks them.
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
Then unblock the script for execution with UnblockFile .\build.ps1
.EXAMPLE
.\build.ps1
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
Execute the build and see what's going on.
.EXAMPLE
.\build.ps1 -SourcesPath '~/custom/vendors.json'
Build cmder with your own packages. See vendor/sources.json for the syntax you need to copy.
.NOTES
AUTHORS
Samuel Vasko, Jack Bennett
Part of the Cmder project.
.LINK
https://github.com/bliker/cmder - Project Home
#>
[CmdletBinding(SupportsShouldProcess=$true)]
Param(
# CmdletBinding will give us;
# -verbose switch to turn on logging and
# -whatif switch to not actually make changes
# Path to the vendor configuration source file
[string]$sourcesPath = "..\vendor\sources.json",
# Vendor folder location
[string]$saveTo = "..\vendor\",
# Launcher folder location
[string]$launcher = "..\launcher",
# Include git with the package build
[switch]$Full
)
. "$PSScriptRoot\utils.ps1"
$ErrorActionPreference = "Stop"
Push-Location -Path $saveTo
$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
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 = "tmp/$($s.name).tmp"
Delete-Existing $tempArchive
Delete-Existing $s.name
Invoke-WebRequest -Uri $s.url -OutFile $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"
}
Pop-Location
Push-Location -Path $launcher
msbuild CmderLauncher.vcxproj /p:configuration=Release
Pop-Location
Write-Verbose "All good and done!"

58
scripts/pack.ps1 Normal file
View File

@ -0,0 +1,58 @@
<#
.Synopsis
Pack cmder
.DESCRIPTION
Use this script to pack cmder into release archives
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
Then unblock the script for execution with UnblockFile .\pack.ps1
.EXAMPLE
.\pack.ps1
Creates default archives for cmder
.EXAMPLE
.\build -verbose
Creates default archives for cmder with plenty of information
.NOTES
AUTHORS
Samuel Vasko, Jack Bennett, Martin Kemp
Part of the Cmder project.
.LINK
https://github.com/bliker/cmder - Project Home
#>
[CmdletBinding(SupportsShouldProcess=$true)]
Param(
# CmdletBinding will give us;
# -verbose switch to turn on logging and
# -whatif switch to not actually make changes
# Path to the vendor configuration source file
[string]$cmderRoot = "..",
# Vendor folder locaton
[string]$saveTo = "..\build"
)
. "$PSScriptRoot\utils.ps1"
$ErrorActionPreference = "Stop"
Ensure-Executable "7z"
$targets = @{
"cmder.zip" = $null;
"cmder.7z" = $null;
"cmder_mini.zip" = "-x!`"vendor\msysgit`"";
}
Delete-Existing "..\Version*"
Cleanup-Git
$version = Invoke-Expression "git describe --abbrev=0 --tags"
(New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null
foreach ($t in $targets.GetEnumerator()) {
Create-Archive $cmderRoot "$saveTo\$($t.Name)" $t.Value
$hash = (Digest-MD5 "$saveTo\$($t.Name)")
Add-Content "$saveTo\hashes.txt" $hash
}

96
scripts/utils.ps1 Normal file
View File

@ -0,0 +1,96 @@
function Ensure-Exists ($path) {
if (-not (Test-Path $path)) {
Write-Error "Missing required $path! Ensure it is installed"
exit 1
}
return $true > $null
}
function Ensure-Executable ($command) {
try { Get-Command $command -ErrorAction Stop > $null }
catch {
If( ($command -eq "7z") -and (Test-Path "$env:programfiles\7-zip\7z.exe") ){
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
}
Else {
Write-Error "Missing $command! Ensure it is installed and on in the PATH"
exit 1
}
}
}
function Delete-Existing ($path) {
Write-Verbose "Remove $path"
Remove-Item -Recurse -force $path -ErrorAction SilentlyContinue
}
function Extract-Archive ($source, $target) {
Invoke-Expression "7z x -y -o$($target) '$source' > `$null"
if ($lastexitcode -ne 0) {
Write-Error "Extracting of $source failied"
}
Remove-Item $source
}
function Create-Archive ($source, $target, $params) {
$command = "7z a -x@`"$source\packignore`" $params $target $source > `$null"
Write-Verbose "Running: $command"
Invoke-Expression $command
if ($lastexitcode -ne 0) {
Write-Error "Compressing $source failied"
}
}
# If directory contains only one child directory
# Flatten it instead
function Flatten-Directory ($name) {
$child = (Get-Childitem $name)[0]
Rename-Item $name -NewName "$($name)_moving"
Move-Item -Path "$($name)_moving\$child" -Destination $name
Remove-Item -Recurse "$($name)_moving"
}
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 Cleanup-Git () {
$gitdir = '/vendor/msysgit/libexec/git-core/'
Get-Childitem $gitdir -Exclude git.exe | Where-Object{!($_.PSIsContainer)} | Foreach-Object { Remove-Item $_.FullName }
}
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`" "
}
}

38
vendor/init.bat vendored
View File

@ -2,9 +2,14 @@
:: Sets some nice defaults
:: Created as part of cmder project
:: Find root dir
@if not defined CMDER_ROOT (
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" (
@ -22,14 +27,37 @@
@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\msysgit"
)
:: Add git to the path
@if defined GIT_INSTALL_ROOT (
set "PATH=%GIT_INSTALL_ROOT%\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=%PATH%;%CMDER_ROOT%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%git_install_root%\share\vim\vim73;
@set PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%
:: Add aliases
@doskey /macrofile="%CMDER_ROOT%\config\aliases"
:: Set home path
@set HOME=%USERPROFILE%
@if not defined HOME set HOME=%USERPROFILE%
@if defined CMDER_START cd /d "%CMDER_START%"
@if defined CMDER_START (
@cd /d "%CMDER_START%"
) else (
@if "%CD%\" == "%CMDER_ROOT%" (
@cd /d "%HOME%"
)
)
:: @call "%CMDER_ROOT%/bin/agent.cmd"

52
vendor/profile.ps1 vendored Normal file
View File

@ -0,0 +1,52 @@
# 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 {
Get-command -Name "git" -ErrorAction Stop >$null
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($gitStatus){
checkGit($pwd.ProviderPath)
}
$global:LASTEXITCODE = $realLASTEXITCODE
Write-Host "`nλ" -NoNewLine -ForegroundColor "DarkGray"
return " "
}
# Load special features come from posh-git
if ($gitStatus) {
Enable-GitColors
Start-SshAgent -Quiet
}
# Move to the wanted location
if (Test-Path Env:\CMDER_START) {
Set-Location -Path $Env:CMDER_START
} elseif ($Env:CMDER_ROOT -and $Env:CMDER_ROOT.StartsWith($pwd)) {
Set-Location -Path $Env:USERPROFILE
}

2132
vendor/psmodules/PsGet/PsGet.psm1 vendored Normal file

File diff suppressed because it is too large Load Diff

22
vendor/sources.json vendored Normal file
View File

@ -0,0 +1,22 @@
[
{
"name": "msysgit",
"version": "1.9.5-preview20150319",
"url": "https://github.com/msysgit/msysgit/releases/download/Git-1.9.5-preview20150319/PortableGit-1.9.5-preview20150319.7z"
},
{
"name": "clink",
"version": "0.4.4",
"url": "https://github.com/mridgers/clink/releases/download/0.4.4/clink_0.4.4.zip"
},
{
"name": "conemu-maximus5",
"version": "150513",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v15.05.13/ConEmuPack.150513.7z"
},
{
"name": "clink-completions",
"version": "0.1.0",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.1.0.zip"
}
]