-
Notifications
You must be signed in to change notification settings - Fork 587
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
Redirect cursor hide/show to stderr #456
Conversation
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
c3eaf9d
to
c87f349
Compare
Benchmark Test ResultsBenchmark results from the latest changes vs base branch
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be the first to admit my ANSI skills are lacking, but from what I can tell in the code changes, it looks like things were already logging to stderr, and had some questions re: the actual hide and show cursor methods (sorry if those questions are things I should know already)
The other question I have is if there's any testing required (but you've mentioned before that we haven't typically unit tested the ETUI stuff in the past)
return nil | ||
} | ||
|
||
func hideCursor(output io.Writer) { | ||
fmt.Fprint(output, "\x1b[?25l") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we get a method comment to add some context here? I have some general questions that might be implicit in the method name, but want to make sure...
- what does the
\x1b[?25l
code correspond to? - why does printing it to the specified output stream hide the cursor?
These questions also apply to the showCursor method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry @dakaneye , just as I merged your message popped up (I didn't refresh). I'll come back after the next couple of meetings and provide further context here 👍
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
#448 pulled in an external lib to perform hiding/showing the cursor. However, this needs to be done relative to the right output stream (in our case, stderr), otherwise
syft | less
will continue to show the cursor.This PR restores this functionality.