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

single-line output of external command to status bar #678

Merged
merged 2 commits into from
Jul 26, 2017

Conversation

rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Jul 18, 2017

Adds new external command option flag +, meaning "echo first line of the output to the status bar". Unlike !, output is integrated into the regular TUI and need not be manually dismissed.

Example usage:

# Show commit statistics for the author under the cursor
bind main U +sh -c 'git --no-pager shortlog -s --author="$(git show -s --format=%aE %(commit))" </dev/tty'

I think this is a good feature, but recognize that open_external_viewer() is taking too many params.

It might be better if the feature was "collapse whitespace and display as much output as fits in one screen width", though the user can get that by appending | xargs to a command.

(Odd little bug in git-shortlog: no output from the above command without </dev/tty.)

Edit: flagname +

@jonas
Copy link
Owner

jonas commented Jul 18, 2017

Very nice. Didn't look yet, but from the description I'd prefer another symbol than _ because it is hard to read. Unfortunately < is used for quitting so maybe >?

Seems to fix #557 and #200.

@rolandwalker
Copy link
Contributor Author

I actually wanted > for something else. Would % be okay? Or +?

and pass it along to io_run
@rolandwalker rolandwalker force-pushed the single-line-output branch 2 times, most recently from a8bfd9d to b4adc14 Compare July 25, 2017 16:26
@jonas
Copy link
Owner

jonas commented Jul 26, 2017

Yes, + looks better. Although I am almost up for using < and finding another modifier for exiting.

@jonas jonas merged commit a6eb110 into jonas:master Jul 26, 2017
@rolandwalker rolandwalker deleted the single-line-output branch July 26, 2017 23:44
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

Successfully merging this pull request may close these issues.

2 participants