-
Notifications
You must be signed in to change notification settings - Fork 609
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
cannot bind complex external commands #65
Comments
The external command is run with You can either do
Which will work or make the command a git alias or somesuch. |
The sh trick didn't work, I already tried that:
None of those put anything in the clipboard, the first three didn't have any output, the 5th and 6th had an empty line as output, and the 4th:
But this worked:
I can work with that, thank you for the suggestion! But certainly it is a complex workaround. Shouldn't something a bit more complex (but surely not highly sophisticated) work with bindings? |
I'll have a look at it at some point and see if it's workable to execute aliases in a subshell (which would let things like pipelines and output redirection work). Ultimately, it's @jonas' call anyway, I'm just an interested party and don't have any sway in the project. |
That's cool. I've got it working for now thanks to your hint. And maybe it's getting even easier in future versions. |
I've already run into this issue, a solution can be to use system() if the command contains a pipe: https://gist.github.com/2883502 With this, bindings such as |
Tig originally supported this kind of bindings. It was changed in 10b1023 to stream-line general IO handling. See line 2818 We can reintroduce it if a majority finds it useful and somebody is ready to submit a patch. Just make sure that you properly shell quote all the arguments passed to system(). See a6113cb for the original sq_quote() lifted from git.= |
Actually would be very nice to have the suggested clipboard action as a core tig functionality. But I guess it's a very OS dependent issue. |
With the above commit you can now bind a key to update the clipboard with the commit ID, for example:
|
I'm not sure how long ago (about half a year, would be my guess), but this exact command that @jonas posted does not work anymore. I tried a couple of different commands and my conclusion is that |
See #986. |
This works just fine for my in Linux.
But on Mac this is not working.
It prints tig version 2.5.0 |
|
Can't this be closed? I have an external command with a pipe embedded in 'sh -c' in my tigrc and it works nicely. It is also more explicitly documented with 2fb8025 |
I want to add a binding to put the current commit hash into the system's clipboard (Mac OS X), so here's my .gitconfig
The output of this is:
So my assumption is that everything after the first space is treated as a parameter and passed to the command before the first space. This isn't a pbcopy issue, the following also doesn't work:
This outputs (no file created):
The text was updated successfully, but these errors were encountered: