Skip to content

feat: support PM and SOS sequences#31

Merged
caarlos0 merged 1 commit intocharmbracelet:mainfrom
mkotowski:feat/pm_and_sos
Dec 4, 2024
Merged

feat: support PM and SOS sequences#31
caarlos0 merged 1 commit intocharmbracelet:mainfrom
mkotowski:feat/pm_and_sos

Conversation

@mkotowski
Copy link
Copy Markdown
Contributor

Add support for PM (Privacy Message) and SOS (Start of String) as defined in ECMA-48.

Colors for PM were chosen more or less arbitrarily. Colors of SOS are set identical to Text since SOS is practically unused (spare more appealing/distinct colors for eventual future stuff) and is designed to carry special class of strings, so it is somewhat close semantically to normal text.

Since both do not have any implementations (that I am aware of) with sub-parameters, their handling was placed directly in process, instead as part of handlers' maps.

Most terminals simply do not render text enclosed by PM or SOS. GNU screen uses PM for its message line facility.

Example output:

λ echo -ne '\x1b^Private message\x1b\\Normal text\x1bXExample control string\x1b\\' | ./sequin
  PM : Privacy message "Private message"
Text Normal text
 SOS : Control string "Example control string"

Screenshot_20241123_150652
Screenshot_20241123_150743

@mkotowski mkotowski mentioned this pull request Nov 23, 2024
@caarlos0 caarlos0 marked this pull request as ready for review November 23, 2024 17:24
@caarlos0
Copy link
Copy Markdown
Contributor

didn't mean to mark it 'ready to review', can't undo it apparently, sorry 😢

@mkotowski mkotowski requested a review from caarlos0 November 23, 2024 20:12
@mkotowski
Copy link
Copy Markdown
Contributor Author

@caarlos0 fixed 😉

@mkotowski mkotowski marked this pull request as draft November 23, 2024 21:03
@coveralls
Copy link
Copy Markdown

coveralls commented Nov 26, 2024

Pull Request Test Coverage Report for Build 12154659882

Details

  • 50 of 59 (84.75%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 87.411%

Changes Missing Coverage Covered Lines Changed/Added Lines %
theme.go 8 10 80.0%
main.go 42 49 85.71%
Totals Coverage Status
Change from base Build 12120569242: -0.2%
Covered Lines: 736
Relevant Lines: 842

💛 - Coveralls

@mkotowski mkotowski marked this pull request as ready for review November 27, 2024 18:03
Copy link
Copy Markdown
Contributor

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

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

lgtm!

can you resolve the merge conflict?

thanks so much! <3

Add support for PM (Privacy Message) and SOS (Start of String) as
defined in ECMA-48.

Signed-off-by: Michał Kotowski <dev@mkotowski.dev>
@mkotowski
Copy link
Copy Markdown
Contributor Author

@caarlos0 done, rebased on current main 🙂

@caarlos0 caarlos0 merged commit 77e1b40 into charmbracelet:main Dec 4, 2024
@caarlos0
Copy link
Copy Markdown
Contributor

caarlos0 commented Dec 4, 2024

Thank you @mkotowski! <3

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.

4 participants