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

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

Closed
majutsushi opened this issue Sep 18, 2013 · 13 comments
Milestone

Comments

@majutsushi
Copy link

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.

@jonas
Copy link
Owner

jonas commented Sep 19, 2013

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.

@majutsushi
Copy link
Author

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.

jonas added a commit that referenced this issue Mar 29, 2014
Instead of prompting the user to 'Press Enter to continue', drop
directly back into last view after edit when no error was reported by
the editor

References #200
@linduxed
Copy link

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

@edi9999
Copy link
Contributor

edi9999 commented May 18, 2015

I like that idea too

@jonas
Copy link
Owner

jonas commented May 18, 2015

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
#200 (comment).

@edi9999
Copy link
Contributor

edi9999 commented May 18, 2015

Maybe something like :

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

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

@edi9999
Copy link
Contributor

edi9999 commented May 18, 2015

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

@edi9999
Copy link
Contributor

edi9999 commented Jun 22, 2015

Any update on this ?

@jonas
Copy link
Owner

jonas commented Jun 22, 2015

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
#200 (comment).

Jonas Fonseca

@jonhiggs
Copy link

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.

@nishantvarma
Copy link

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.

@netei
Copy link

netei commented Sep 14, 2015

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"'

@jonas
Copy link
Owner

jonas commented Jul 27, 2017

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

@jonas jonas closed this as completed Jul 27, 2017
@jonas jonas added this to the tig-2.3 milestone Jul 27, 2017
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

7 participants