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

Fix ansi problem #42

Merged
merged 1 commit into from
Oct 12, 2018
Merged

Fix ansi problem #42

merged 1 commit into from
Oct 12, 2018

Conversation

lugray
Copy link
Contributor

@lugray lugray commented Oct 12, 2018

CLI::UI::ANSI.end_of_line was broken in a couple of ways. First, it didn't actually move to the end of the line, it advanced the cursor by one place. Second, it was printing an extra escape sequence opener to do so (\e[\e[C instead of \e[C). Some terminals were ignoring this invalid output, but others showed a character for it.

Given it wasn't doing the job it advertised, and that I could not find a trivial sequence that would, and where it was being used it clearly wasn't needed since it wasn't doing the job we thought it was, I removed it, and adjusted the places where it was being used.

Fixes #39.

@lugray lugray requested a review from burke October 12, 2018 13:01
# Move to the end of the line
#
def self.end_of_line
control("\033[", 'C')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW \033[9999C seems to do the trick.

@lugray lugray merged commit ba85dfa into master Oct 12, 2018
@lugray lugray deleted the ansi_fix branch October 12, 2018 17:15
@lugray lugray temporarily deployed to production November 9, 2018 18:39 Inactive
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