Tig: Empty or one-line output from external commands should not create "Press ENTER" prompt

Created on 18 Sep 2013  Â·  13Comments  Â·  Source: jonas/tig

I would like to echo a short status message after the suggested "copy revision to clipboard" binding to confirm that the command has been executed, but that requires me to hit Enter after every copy which is quite annoying. If the output is short enough to fit into one line there is no real need to prompt the user for confirmation.

Most helpful comment

Fixed in 4a3d90a, which uses the + modifier. I am considering to rewire it to < (which currently means quit-after-command).

All 13 comments

Just to understand you correctly. You are using something like:

bind generic 9 @sh -c "echo -n %(commit) | xclip -selection c"

which executes the command in the background with no console output.

You would like to be able to see in the status line of tig, either the first line of the console output or some sort of status message based on the exit code of the command.

Yes, exactly. So I could for example do this:

generic = y !sh -c 'echo -n %(commit) | xclip -i -selection clipboard && echo "copied %(commit) to clipboard"'

without having to press Enter after the message.

I'm wondering the same thing. Is there some way to echo out something to the status line at the bottom?

I like that idea too

Me too ;).

But I would prefer it would require a special flag(suggestions are welcome)
that turns this on since capturing output could increase memory usage
considerably for verbose commands. Ideally this flag would cause the
command to be executed with stdout being a pipe from which tig can read and
simply remember the last line.
On May 18, 2015 11:10, "Edgar Hipp" [email protected] wrote:

I like that idea too

—
Reply to this email directly or view it on GitHub
https://github.com/jonas/tig/issues/200#issuecomment-103091326.

Maybe something like :

bind generic 9 <@ sh -c 'echo "copied"'

The < meaning take the output from that command to tig.

I think that's how it works also with the confirm flag with ?@

Any update on this ?

Didn't get around to working on this, yet.

On Mon, Jun 22, 2015 at 7:48 AM, Edgar Hipp [email protected]
wrote:

Any update on this ?

—
Reply to this email directly or view it on GitHub
https://github.com/jonas/tig/issues/200#issuecomment-114076420.

Jonas Fonseca

I'd like to +1 this issue too. My first guess to fix it was adding a or two to the end but that didn't work.

This can also help when you do a git push origin right? Would like to avoid the extra enter usually ... the alternative currently is to do pull in Vim which can execute a command silently.

Yes, if that syntax was implemented, you could do something like :

bind generic p <@ sh -c 'git push origin master > /dev/null && echo "Done" || echo "Fail"'

Fixed in 4a3d90a, which uses the + modifier. I am considering to rewire it to < (which currently means quit-after-command).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

szz picture szz  Â·  5Comments

achikin picture achikin  Â·  7Comments

Anrock picture Anrock  Â·  8Comments

rominf picture rominf  Â·  6Comments

hSATAC picture hSATAC  Â·  8Comments