summaryrefslogtreecommitdiffstats
path: root/content/posts/openbsd-weechat-separator-fix/index.org
blob: 35446e87e5a4a868612394d1eee9b737a114a562 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#+TITLE: OpenBSD Weechat Question Mark Message Separator Fix
#+DATE: 2024-02-23T19:46:49-05:00
#+DRAFT: false
#+DESCRIPTION: Fix the weechat message separator character being replaced by a question mark on OpenBSD
#+TAGS[]: weechat openbsd
#+KEYWORDS[]: weechat openbsd
#+SLUG:
#+SUMMARY:

#+ATTR_HTML: :title OpenBSD weechat separator fix
#+ATTR_HTML: :alt OpenBSD weechat separator changing from a question mark to a pipe character
[[file:cover.png]]


I just solved what was becoming a very aggravating issue thanks to the
help from the folks in the =#weechat= channel in Libera.Chat.

On OpenBSD, my =weechat= client would put a question mark to separate
the nicks and the messages sent with a question mark instead of a
pipe-looking character like it should.

It looks like this was caused by opening =weechat= without having the
correct locale set. By default, OpenBSD uses a locale of =C=, which
only supports =ASCII= characters. According to the [[https://www.openbsd.org/faq/faq10.html#locales][FAQ]] however, you
should be able to set your locale to =en_US.UTF-8= to get unicode
support when available.

The confusing thing was that after correctly setting the locale to
UTF-8 by adding the following line to my =~/.profile=, it was still broken.

#+begin_src sh
export LC_ALL=en_US.UTF-8
#+end_src

It looks like the reason was that =weechat= had saved
=weechat.look.prefix_suffix= as =?= after opening in a locale that
doesn't support the character it wanted to use. The fix was to run
=/unset weechat.look.prefix_suffix= after setting the correct locale.

I also plan on keeping =weechat= open in a =tmux= buffer. By default,
=tmux= on OpenBSD uses =TERM=screen=, which only supports a very
limited set of colors. To let =weechat= use a richer color pallet, I
have to let it know the terminal support 256 colors. I can do this by
using the =tmux-256color= =TERM= environment variable when inside of a
session.

To do that, I add the following line to my =~/.tmux.conf= file.

#+begin_src conf
set -g default-terminal "tmux-256color"
#+end_src

Now everything looks as it should and we're ready to idle!