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

list - minor display issues #114

Closed
flatcap opened this issue Feb 1, 2017 · 5 comments · Fixed by #116
Closed

list - minor display issues #114

flatcap opened this issue Feb 1, 2017 · 5 comments · Fixed by #116
Assignees

Comments

@flatcap
Copy link

flatcap commented Feb 1, 2017

The output of the "list" command has the escape sequence ^[[?25 (reveal cursor) at the end.
Is this intentional? If so, please can you disable it when the output is redirected?

The output of the "list -l" command isn't all sent to the same output stream.
The header is send to stderr, the body to stdout.

@guyzmo
Copy link
Owner

guyzmo commented Feb 1, 2017

The output of the "list" command has the escape sequence ^[[?25 (reveal cursor) at the end.
Is this intentional? If so, please can you disable it when the output is redirected?

I'm not sure, IIRC the reveal cursor was to fix an issue with the progress bar widget. Sure I'll check.

The output of the "list -l" command isn't all sent to the same output stream.
The header is send to stderr, the body to stdout.

that's on purpose, to avoid having to drop header upon redirection, a 2>&1 is easier than tail -n +2. Though I could simply not print the header if in a redirect. What is your use case, so I can think about it?

@flatcap
Copy link
Author

flatcap commented Feb 1, 2017

The header is send to stderr, the body to stdout.

that's on purpose, to avoid having to drop header upon redirection

Oh, OK. I don't think I know of any other programs that do that.

I was just saving a list of repos to a file.
I think I'd rather delete a header than redirect stderr.
If something goes wrong with git-repo, that should be on stderr, where I can see it.

@guyzmo
Copy link
Owner

guyzmo commented Feb 1, 2017

an alternative would be a -q or --batch option to suppress colours and headers. But that would mean also keeping headers in stdout.

guyzmo added a commit that referenced this issue Feb 3, 2017
added a generator logic for displaying lists,
that's following this algorithm:

- yield the format
- yield the header (as tuple matching the format)
- yield content line by line (as tuple matching the format)

and do not display the header when not sending to a tty
and do not display the "cursor display" character voodoo when not
sending to a tty.

fixes #114

Signed-off-by: Guyzmo <[email protected]>
@guyzmo guyzmo self-assigned this Feb 3, 2017
@guyzmo guyzmo added the backlog label Feb 3, 2017
@guyzmo
Copy link
Owner

guyzmo commented Feb 3, 2017

cf attached PR:

  • removed the ceveal cursor character when not outputing in a terminal (`sys.stdout.isatty() FTW)
  • made headers not appearing when not in a terminal (again)

and a bit of internal cooking 😉

@guyzmo guyzmo added in progress and removed backlog labels Feb 3, 2017
guyzmo added a commit that referenced this issue Feb 3, 2017
added a generator logic for displaying lists,
that's following this algorithm:

- yield the format
- yield the header (as tuple matching the format)
- yield content line by line (as tuple matching the format)

and do not display the header when not sending to a tty
and do not display the "cursor display" character voodoo when not
sending to a tty.

fixes #114

Signed-off-by: Guyzmo <[email protected]>
@guyzmo guyzmo removed the in progress label Feb 3, 2017
@flatcap
Copy link
Author

flatcap commented Feb 3, 2017

Thanks

guyzmo added a commit that referenced this issue Feb 6, 2017
🚧 Features

* Gogs (fixes #18) (kudos @pyhedgehog)
* certificate pinning (fixes #88)
* non-standard http ports (fixes #81)
* possibility to use custom SSH address (fixes #107)
* .gitconfig in XDG home directory (fixes #95)
* .gitconfig's proxy definition support (fixes #105)
* automatically grab PR title/body from last commit (fixes #73)

🚒 Bugfixes

* refactoring of listings, improved list command (fixes #114)

💄 Cosmetics

* Switch to a git tag scheme for versioning (using setuptools-scm)
* Updated README with new informations
* Added @pyhedgehog to contributors
* Updated TODO list

Signed-off-by: Guyzmo <[email protected]>
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 a pull request may close this issue.

2 participants