Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmder console commands #181

Closed
namanyayg opened this issue Apr 15, 2014 · 7 comments
Closed

Cmder console commands #181

namanyayg opened this issue Apr 15, 2014 · 7 comments

Comments

@namanyayg
Copy link

Is there any simple way to pass instructions to cmder through cmd or cmder itself? Example, something like creating a new tab, opening cmder in the current location, etc.

@Jackbennett
Copy link
Contributor

Cmder is some special sauce into conEmu.

Conemu can do all you ask. I think the defaults are win+w for the new tab window.

ConEmu Settings are win+alt+p. rummaging through that you should find all you want. It's a bit unfriendly though.

@namanyayg
Copy link
Author

Thanks for the help! Though I'm still not able to figure out how do manipulate cmder through console commands. For example, I want to create an alias the duplicates the root and runs a specific command on the newly created tab - is that possible? Thanks!

@Jackbennett
Copy link
Contributor

I think what you want to be editing is a custom profile that runs in the process.

cmder seems to use init.bat so you could try modifying that?

If you use the powershell console edit the file in $profile.currentUserAllHosts

@namanyayg
Copy link
Author

I'm not exactly sure what I can do in the custom profile, kinda a newb here.

I've tried experimenting with doing things like:

cmder -new_console this creates a new window' instead of a tab, and requires me to go into the cmder install directory (This could be bypassed if I use an alias or add cmder to my path, though)

conemu -new_console simply minimizes the window. Not sure what's going on here.

cmd -new_console works to a degree, but it creates a new CMD tab instead of the cmder tab. I cannot use things like git, then.

@Arcovion
Copy link

Arcovion commented May 9, 2014

I'd like to know if there's a way to invoke Cmder like cmd.exe;
If you make a shortcut to cmd /k "dir" it'll open a prompt, run the command "dir" and keep it open.

You can invoke git bash with <cmder_path>/vendor/msysgit/bin/sh.exe -lc "ls", this will run your command (ls) then exit.

Now, you can combine the above commands and make a shell that stays open, but it'll be in the ugly command prompt window. I'm asking if I can do it with Cmder, just run a command and stay open.

Edit: I just saw https://github.com/bliker/cmder/blob/master/Cmder.bat, this wasn't in my download for some reason. Looks like I should be able to pipe commands to ConEmu, but it's not really working... maybe someone who has done this before can help me?

Update: Solved it, so cmder.bat should look like this:

@echo off
set CMDER_ROOT=%~dp0
start %CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.exe /icon "%CMDER_ROOT%\cmder.exe" /title Cmder /loadcfgfile "%CMDER_ROOT%\config\ConEmu.xml" /cmd cmd /k "%CMDER_ROOT%\vendor\init.bat cd %CD% && %~1"

Now running cmder.bat "ls && dir" will open Cmder, run the commands and stay open. It's the proper Cmder shell (not just git bash) so, as you can see, both ls and dir work.

@namanyayg You can use all of these commands if you pass the options to ConEmu via cmder.bat, the page lists examples of how to create tabs etc.

@thshdw
Copy link

thshdw commented Jun 10, 2016

See also #457

@Jackbennett
Copy link
Contributor

Looks like another one relevant to #370 with 457 a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants