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

Feature Request: Bold and italics terminal font #325

Closed
mcastorina opened this issue Mar 21, 2017 · 16 comments
Closed

Feature Request: Bold and italics terminal font #325

mcastorina opened this issue Mar 21, 2017 · 16 comments

Comments

@mcastorina
Copy link

mcastorina commented Mar 21, 2017

It would be nice to display text surrounded by * or _ as bold or italic in the buffer like in Slack.
e.g. *this text is bold* and _this text is italic_

@ToxicFrog
Copy link
Collaborator

Implemented in #338

@auscompgeek
Copy link
Contributor

I'm not seeing italics.

@ToxicFrog
Copy link
Collaborator

IRC doesn't support italics (and neither do most terminal emulators); italics in slack get rendered as underlines in IRC, and vice versa.

@chreekat
Copy link

I'm not upset with the way things are, but my terminal (Gnome Terminal) does support italics, and I think it would be nice to keep the option open for the future.

@ToxicFrog
Copy link
Collaborator

It looks like weechat itself supports italics if the terminal and libcurses do, so I don't see any technical obstacles to this.

It shouldn't be hard to add a configuration setting to toggle between rendering italics as underline vs. as italics.

@chreekat
Copy link

Yeah, I was just trying it out -- weechat's /help trigger even lists the necessary trigger for bold/underline/italic as an example[1]. :) Unfortunately it wasn't immediately successful: it did the "use reverse in place of italics" hack that I've seen elsewhere and don't immediately recall how to fix...

[1]: Copied here:

/trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*(\S+)\*==*${color:bold}${re:1}${color:-bold}*== ==_(\S+)_==_${color:underline}${re:1}${color:-underline}_== ==/(\S+)/==/${color:italic}${re:1}${color:-italic}/"

@mcastorina
Copy link
Author

Bold and italic doesn't appear to be working: *_bold and italic_*

@ToxicFrog
Copy link
Collaborator

Testing: *_bold and italic_* renders as _bold and italic_ in bold, and _*italic and bold*_ renders as *italic and bold* in italic (well, underlined).

Looking at the code I would expect the former to work even if the latter doesn't.

@ToxicFrog
Copy link
Collaborator

If they aren't nested side by side it works, e.g. _italic and *bold* in the middle_ renders correctly.

@auscompgeek
Copy link
Contributor

IRC doesn't support italics

IRC does have italics. weechat has the default keybind of C-c i to make text italics.

@ToxicFrog
Copy link
Collaborator

What does this turn into on the wire? Because most clients don't support it, and last time I saw someone try to use an italics-enabled client on IRC it sent ^I as the italics code, otherwise known as TAB, which didn't really work out so well.

@auscompgeek
Copy link
Contributor

That's why everyone standardised on \x1D. I don't know of any maintained clients that don't support italics nowadays.

@ToxicFrog
Copy link
Collaborator

Huh. I don't think I've ever seen that in the wild, or if I did, it didn't work with the clients I was using (mostly hexchat and weechat).

At any rate, I'm working on a patch that should enable italic support for weeslack, but someone else will need to test it, because I don't have my tty set up for italic support.

@ToxicFrog
Copy link
Collaborator

ToxicFrog commented Apr 15, 2017

Looks like this is going to add three new settings:

  • render_bold_as controls how incoming *bold* is rendered
  • render_italic_as controls how incoming _italic_ is rendered
  • map_underline_to controls how outgoing underlines are rendered in slack

With default settings of bold, italic, and _ respectively.

@ToxicFrog
Copy link
Collaborator

See PR #350

@ToxicFrog
Copy link
Collaborator

PR/#350 adds italics support, and options to translate italics to underline for people whose terminals don't support italics.

I/#354 tracks issues with nested formatting characters.

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

No branches or pull requests

4 participants