-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Detect whether ConEmu/Console2/whatever is installed and offer to use that instead of mintty #96
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
Comments
Hmm, I don't really know how to do that with conemu, and the fact that conemu can be installed as portable (no registry, only local xml settings) makes that quite hard to do for some setups. |
@oysteinkrog That will be my last resort, but I am not ready to give up just yet 😜 Anyway, could you elaborate on the local xml settings? Are they stored in a file in the portable app, or in the home directory? And... how would you call ConEmu from |
Ok I think this works: I have my conemu xml settings in the same directory as the exe, but not really on purpose. |
Also tested with just this in the task file: |
Just for fun, would you be willing to use a resource editor like "usr\\bin\\mintty.exe -i /mingw64/share/git/git-for-windows.ico /usr/bin/bash --login -i" with "C:\path\to\ConEmu64.exe" /cmd "/usr/bin/bash --login -i" and then double-click it in the Explorer? |
Ok did that, replaced with: When starting from explorer, conemu prints:
|
When using this instead it works:
The contents of the file is the same as that of a task. |
So you need BTW I really would like to avoid an extra text file, it is cumbersome to keep around... |
Well yes, I use conemu as quake-like console (drop down) with tabs (can have cmd etc as tabs). |
I can't get conemu /cmd "bash.exe" to work though, only the file-based approach, tried lots of different versions, but I might just be missing something. |
I'm just wondering whether the use case you guys described is actually worth looking into. I dare to assume that most ConEmu/Console2/whatever users are not limiting themselves to Git bash tasks (tab kinds). I myself, have always had at least Cmd, PowerShell and Bash (with Git) tasks configured and can start each of those in a new tab with some global ConEmu shortcut. Therefore, starting Git Bash in ConEmu via an external executable (such as git-bash.exe) does not bring much value in that case. As for detecting whether 3rd party console tools are installed in the system - this is a struggle, since some users always go for stand-alone packages and so registry settings on Windows are not a viable option. Then, as long as you cannot get the feature working for majority, I wouldn't bother. One thing I think could be useful and does not require much work, is a short section in README, which provides a short "how to use git-for-windows from 3rd party terminal tools" guide with samples. |
Agreeing 100% with your comment, jaccus. ConEmu is the terminal, bash is the shell. The terminal runs the shell, not the other way around. What we could do is to work with ConEmu developer, Maximus5, to provide a task for us in ConEmu. As others have said, |
Well, at the moment you hardcode
People do not read the README. Period. Just have a look at how many issues are reported in https://github.com/msysgit/msysgit/issues and https://github.com/msysgit/git/issues that would have been addressed in the release notes iff people bothered to read them...
True. What I want to do is not let the
I get the distinct impression that there is an assumption going on that everybody understands what ConEmu means by "task". Obviously, I don't, though. Do I need to learn about this? If yes, would any of you gentle people be willing to summarise for somebody who is not inclined to become a user of ConEmu but still wants to support Git users who are infatuated with ConEmu?
And as I have pointed out (this time, explicitly): this is prone to get stale. If you are happy to adjust your configuration manually everytime we decide to move things around (for example, the |
You're right. Let me try to explain in a few words. ConEmu is a terminal, i.e. only a container for whatever you might want to run inside it. Typically a shell like cmd.exe, bash.exe, or powershell. One nice thing is that it has tabs and splitting (à la screen/tmux, but handled at the GUI level), and that you can have different shells running in each of those "slots". A task is a type of shell you want available. Each has a name and the actual command to run. For example one task will be called e.g. "Command prompt" and the command would be "cmd.exe", another one would be for git-bash, maybe another one for irssi, etc. Then whenever you create a new tab or split an existing tab, you decide what task you want to run inside that new "slot". I hope that makes it clearer.
You don't really need to, since the beauty of it all is that all those components should be independent from each other. However, since you're into shells and command line, I highly recommend you to try ConEmu. It will help your understanding a lot and maybe even give you nice integration ideas! Heck, you might even like it for yourself. :)
Very fair point. As you pointed out, as a Windows GUI user, I want to be able to click on some icon and get a terminal window with a shell inside, no questions asked. Similarly, as a ConEmu user, I want the same but without the terminal window. In other words, I want to be able to add a stable bat/exe command as a task that would run git-bash "alone" (no GUI), with all the environment being taken care of. |
So how do you provide those "tasks"? Would it make sense to add a "Browse" button that lets the user specify the "ConEmu" location to add that task automatically? |
This comment was marked as abuse.
This comment was marked as abuse.
BTW. When user "installs" ConEmu and runs it first time, ConEmu tries to find known 'shells' and create tasks. So user can choose what he wants to run on startup. |
Not necessarily. ConEmu can introduce huge performance problems in process spawning (git-for-windows/msys2-runtime#6 (comment)), so would need to be benchmarked carefully before recommending it as default. |
There is a conemu PKGBUILD here https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-conemu-git with a default xml configuration file that could be adjusted as desired. |
cmder is bundled with old ConEmu build so it is not a sign. And neither of linked issues are linked to ConEmu project.
It is already possible but as I've said before is strongly not recommended.
Do not see any sense in this PKGBUILD. I believe official version must be always preferred. It is working, supported and can be adjasted with ConEmu.xml by deployers. |
Simple, to fit into Git for Windows' build system. |
There are not only |
It would be nice if Git for Windows could disable conemu hooks when running commands implemented externally (like git-svn) or that use many helpers (like git-fetch). I think they could be disabled for everything, possibly except interactive rebase which may run user-specified commands. |
@jan-hudec |
These are MSys programs. They are unlikely to hit those problems and if they do, appropriate workaround can be made in msys; most of the problems are not really conemu-specific anyway. I am aware, that it is possible on the ConEmu side. I am suggesting to make git disable it for itself only while it remains enabled for any other command the user executes.
Does it apply to msys spawning too?
I was just moving the comment from the wrong place to the place where I should have made it in the first place. So I could not have seen the comments that were made in response to that comment. |
@Maximus5 if we are to bundle ConEmu with Git for Windows, it has to be
So: how large is it? Can you fix the |
I believe msys has same spawning mechanism. You can check the speed yourself if you doubt in... |
Hooray! Sorry I wasn't of more help. |
What have I to run in ConEmu (default Git's Task content) to run git bash?
|
@Maximus5 Here's the ConEmu task command I'm using, based upon the info from here.
It seems to work well, except for an extra tab being created. |
@landstander668 what if you skip the Or is this a ConEmu issue, @Maximus5 ? |
Two tabs is a ConEmu issue I think. |
@dscho I get the exact same behaviour when using |
So after all, what's the proper way to invoke Git2 from ConsoleZ? My biggest problem is that while Git1 used a single binary folder, Git2 uses at least 2 so not even basic commands will work. |
@bviktor the recommended way to access Git for Windows is, and has been, to use |
I think @bviktor want to have bash prompt where git and msys binaries are available (via PATH).
|
Found (and fixed) two-tabs problem within ConEmu. The problem was in CREATE_NEW_CONSOLE flag passed in CreateProcess. It is a spare flag actually because it's implied when console app is starting from GUI app. |
Yep, I think you want to prefix the first argument with a |
Well, But now... May be this way (with |
Yup, I want a shell, not just the git binary itself.
Am I OK if I stick to this last one or will this change after your fix is in place, Maximus? |
It is a pretty new feature, IIRC it only entered Git for Windows with version 2.4.2.
When overriding the command to be called, the only difference between |
@dscho But I can't find way to start bash (via git-cmd.exe or git-bash.exe) in the specified folder instead of user profile. How to implement "git bash here" feature? |
Guys, one quite major issue I've hit with |
Uh, this only happens with this new Git2 Bash, Git1 bash, CMD, PowerShell etc are working fine and don't close upon Ctrl+C. |
Console must not make user experience worse. It anything is working in standard console, the same must be working in the Console. |
Start |
@Maximus5 you can use the |
For the record, |
From https://gist.github.com/shiftkey/add6975be2687d8731ae#comment-1431040 and https://gist.github.com/shiftkey/add6975be2687d8731ae#comment-1432148, it appears that @oysteinkrog and @jaccus figured out ways to run the Git Bash inside ConEmu.
However, it still requires manual setup by users which is not exactly the user experience I am striving for.
There is already support in the Git wrapper (which is used as
git-bash.exe
, for example) to configure (without recompiling) the command-line to be run after setting up the environment variables. If there is interest, I'll gladly describe the technical details.However, for ConEmu/Console2/whatever support, I will need to know two things for each terminal emulator:
bash --login -i
running inside. In other words, the equivalent of"usr\bin\mintty.exe -i /mingw64/share/git/git-for-windows.ico /usr/bin/bash --login -i"
The text was updated successfully, but these errors were encountered: