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 resetting display attributes on VT100 output #85

Merged
merged 1 commit into from
Oct 20, 2018

Conversation

aphistic
Copy link
Contributor

I'm using go-prompt on urxvt on Arch Linux and I'm running into an issue where the bold attribute isn't being reset correctly after its first use. I don't know a lot about ANSI/VT100 but I wasn't able to find the '10' attribute that was currently being used, so I added the '0' attribute in addition to it. This fixed the bold not being reset on my terminal.

I haven't had a chance to test on Windows, Mac or the Gnome Terminal yet.

@coreyog
Copy link

coreyog commented Sep 5, 2018

If it helps, I've made the same changes in a project of mine and works for me.

@sandipb
Copy link

sandipb commented Sep 11, 2018

Patch working for me too. I found this after I filed #93 for it. Thanks!

@@ -236,7 +236,7 @@ func (w *VT100Writer) SetColor(fg, bg Color, bold bool) {
if bold {
w.SetDisplayAttributes(fg, bg, DisplayBold)
} else {
w.SetDisplayAttributes(fg, bg, DisplayDefaultFont)
w.SetDisplayAttributes(fg, bg, DisplayDefaultFont, DisplayReset)
Copy link
Owner

Choose a reason for hiding this comment

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

it seems to be equivalent to following:

w.SetDisplayAttributes(fg, bg, DisplayReset)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was another thing I tried that seemed to work but I didn't want to take out the DisplayDefaultFont in case it did something I wasn't aware of.

Copy link

Choose a reason for hiding this comment

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

@c-bata any progress on merging it?

@c-bata c-bata changed the base branch from master to fix-resetting-attributes October 20, 2018 05:25
@c-bata
Copy link
Owner

c-bata commented Oct 20, 2018

Merge this changes into master after removing DisplayDefaultFont.

@c-bata c-bata merged commit a85c58b into c-bata:fix-resetting-attributes Oct 20, 2018
@c-bata c-bata mentioned this pull request Oct 20, 2018
@c-bata
Copy link
Owner

c-bata commented Oct 20, 2018

Merged this in #104. Thanks.

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.

None yet

5 participants