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

Support cmder #144

Closed
jods4 opened this issue Feb 18, 2021 · 9 comments
Closed

Support cmder #144

jods4 opened this issue Feb 18, 2021 · 9 comments

Comments

@jods4
Copy link

jods4 commented Feb 18, 2021

Cmder is a great console emulator for Windows.

I use it for everything git-related so I'd love if I could replace the "Open in Windows Powershell" entry by "Open in Cmder" (or at least add that option to the list)

@awaescher
Copy link
Owner

Thanks for the suggestion. I'd like to close this issue in favor for #114, which makes the context menu custimizable.
I'd add a note about Cmder over there.

@awaescher
Copy link
Owner

I finally started to work on #114 and set up a new repository to consolidate repository actions from the community.

Would you like to help out adding Cmder to the json file over there?

@jods4
Copy link
Author

jods4 commented Feb 19, 2021

@awaescher Fantastic! Menu and esp. shortcut customisation is the last missing piece to make RepoZ perfect!

I will gladly help you put up a template for Cmder.
Cmder is a cmd/terminal/powershell alternative so you basically want to open a prompt inside the git project folder.
The command to do that is cmder /start [location] (documentation)

The main issue when I see your template is that you seem to always give a full path to the executable.
As you can see on the cmder homepage, it's a fully portable tool and you can unzip it anywhere you want...
It's the kind of tool that you'd put on your path though, so assuming you can put global commands in your template I suggest:

{
  "name": "Open in Cmder",
  "executables": ['cmder.exe'],
  "arguments": '/start "{Repository.SafePath}"',
  "keys": "Ctrl+C",
  "active": "true"
}

If the unknown path location is a problem:

  • maybe assume program files and/or localappdata?
  • try the command where cmder to find out?
  • we can modify the template manually anyway (mine is in C:\Tools\Cmder for example).

@awaescher
Copy link
Owner

That was fast, wow.

Yeah, PATH tools are a bit of a problem by now as I have to check whether the executables exist or not before building the menu. This does not work with commands from the PATH.

I might need to overthink that behavior. I'll add Cmder to the sample configuration, thanks again.

@awaescher
Copy link
Owner

Oh, the shortcut is the same as "Copy". I'd like to change that for the sample.

@jods4
Copy link
Author

jods4 commented Feb 19, 2021

Sure, no problem. Maybe Ctrl+R for "run"? or Ctrl+T for "terminal"?

@jods4
Copy link
Author

jods4 commented Feb 19, 2021

I have to check whether the executables exist or not before building the menu. This does not work with commands from the PATH

Maybe when the executable is just a filename, probe the system with the command where cmder.exe?
It'll tell you if cmder.exe is on the PATH -- and where it is found (notice where can return multiple lines if the same exe is multiple times on path).

@jods4
Copy link
Author

jods4 commented Feb 19, 2021

@awaescher Can I suggest a small tweak to the Cmder invocation?

Cmder is a tabbed console, the command I gave you above would create one new window at every invocation, regardless whether Cmder is already open or not.

I think a better default behaviour is to add a new tab to the existing window if it's already open, which can be done with the /single switch:

"arguments": '/single /start "{Repository.SafePath}"'

@awaescher
Copy link
Owner

Thank you very much for this information, I just commited this to RepoZ-RepositoryActions.

RepoZ is not ready to use these definitions yet but I'll be soon 😅

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

2 participants