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

Simplify terminal character style diff #839

Merged

Conversation

tlinford
Copy link
Contributor

@tlinford tlinford commented Nov 6, 2021

These changes make the code a bit simpler, and avoid outputting ansi reset escape codes each time an EMPTY_TERMINAL_CHARACTER is found.

Example output to terminal emulator:

  • before:
"\x1b[3;2H\x1b[mWelcome to fish, the friendly interactive shell\x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m \x1b[m "
  • after:
"\x1b[3;2H\x1b[mWelcome to fish, the friendly interactive shell\x1b[m                                                                 "

return a diff for EMPTY_TERMINAL_CHARACTER only when necessary (when new_styles different than current), so to avoid
emitting a ansi reset code every time.
@tlinford tlinford force-pushed the simplify-terminal-character-style-diff branch from 2c16c1d to 7f9290d Compare November 14, 2021 17:06
@tlinford tlinford merged commit 0ba8e2f into zellij-org:main Nov 15, 2021
@tlinford tlinford deleted the simplify-terminal-character-style-diff branch November 15, 2021 07:32
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.

1 participant