You are not logged in.

#1 2024-04-10 14:11:29

cutecoder
Member
Registered: 2023-08-24
Posts: 10

Problems with xterm, urxvt and tmux

I use urxvt as main terminal. I wanted to expand by using tmux but whenever I start tmux in urxvt it prints part of a control sequence which urxvt can not intepret (it seems like). This sequence is:

^[]10;rgb:ff00/fb00/f600^[^[]11;rgb:1000/1400/2100^[

I tried installing rxvt-unicode-truecolor-wide-glyphs and this fixed this issue (the issue is also not in xterm). However, then arises an issue I had with xterm as well where the font has a huge line spacing which can not even be changed by editing lineSpace in the config. This huge line spacing is not there in rxvt-unicode to my surprise.

This is my tmux config:

unbind C-b
set -g prefix C-a
bind C-a send-prefix
set -g default-terminal "xterm-256color"
set -g escape-time 0

bind-key v split-window -h
bind-key s split-window -v

bind-key h select-pane -L
bind-key l select-pane -R
bind-key k select-pane -U
bind-key j select-pane -D

bind-key n new-window

bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null"
bind-key p run "xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer"

And this is the output of xrdb -query:

$ xrdb -query
*font:	xft:BmPlus IBM VGA 8x16:size=24
*termName:	xterm-256color
*scrollBar:	false
*background:	#101421
*foreground:	#fffbf6
*color0:	#2e2e2e
*color1:	#eb4129
*color2:	#abe047
*color3:	#f6c744
*color4:	#47a0f3
*color5:	#7b5cb0
*color6:	#64dbed
*color7:	#e5e9f0
*color8:	#565656
*color9:	#ec5357
*color10:	#c0e17d
*color11:	#f9da6a
*color12:	#49a4f8
*color13:	#a47de9
*color14:	#99faf2
*color15:	#ffffff
URxvt.perl-ext-common:	selection-to-clipboard,fullscreen,resize-font
URxvt.skipScroll:	true
URxvt.clipboard.autocopy:	true
URxvt.keysym.Control-Shift-c:	perl:clipboard:copy
URxvt.keysym.Control-Shift-v:	perl:clipboard:paste
URxvt.keysym.F11:	perl:fullscreen:switch
URxvt.iso14755:	false
URxvt.iso14755_52:	false
XTerm*saveLines:	15000
XTerm*highlightSelection:	true
XTerm*trimSelection:	true
XTerm*vt100.translations:	#override \n Ctrl <Key>-: smaller-vt-font() \n Ctrl <Key>+: larger-vt-font() \n Ctrl <Key>0: set-vt-font(d) \n Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n Ctrl Shift <Key>V: insert-selection(CLIPBOARD)

I really want to make this font work but I do not have the right configurations in place. I would like to fix both the issue with xterm (huge line spacing) and tmux (prints random sequence on start).


They said get Archlinux, it'll be fun they said... ZOMG I LOVE ARCH

Offline

#2 2024-04-10 19:02:34

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

For tmux you've probably found https://bbs.archlinux.org/viewtopic.php?id=294613 and the sublinks for why this happens.

issue I had with xterm as well where the font has a huge line spacing

*termName:	xterm-256color

Never fake the termName for anything.

xterm*termName: xterm-256color

is acceptable, faking everything else as xterm is a bad idea.

*font:	xft:BmPlus IBM VGA 8x16:size=24
fc-list | grep BmPlus
fc-list :mono
fc-match monospace

Online

#3 2024-04-10 19:28:15

cutecoder
Member
Registered: 2023-08-24
Posts: 10

Re: Problems with xterm, urxvt and tmux

seth wrote:
fc-list | grep BmPlus
fc-list :mono
fc-match monospace

fc-list|grep BmPlus

/usr/share/fonts/font.otb: BmPlus IBM VGA 8x16:style=Regular

fc-list :mono

...
/usr/share/fonts/font.otb: BmPlus IBM VGA 8x16:style=Regular
...

fc-match monospace

NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"

And yes, I saw the post you linked. Although I'm not exactly sure why it happens.


They said get Archlinux, it'll be fun they said... ZOMG I LOVE ARCH

Offline

#4 2024-04-10 19:39:26

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

Does

urxvt -fn "xft:BmPlus IBM VGA 8x16"

work properly?
It's a bitmap fron w/ fixed pixel size, adding a specifig (point) size is probably no good idea.

Online

#5 2024-04-10 19:47:39

cutecoder
Member
Registered: 2023-08-24
Posts: 10

Re: Problems with xterm, urxvt and tmux

The reason I added this size is because otherwise in the rxvt-unicode package it would have the ends of characters slashed off. And for the rxvt-unicode-truecolor-wide-glyphs package it looks like this. xterm does not start at all saying: xterm: Selected font has no non-zero height for ISO-8859-1 encoding but it works with the size being 24 but not for 23 or lower.


They said get Archlinux, it'll be fun they said... ZOMG I LOVE ARCH

Offline

#6 2024-04-10 19:52:23

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

urxvt -fn "xft:BmPlus IBM VGA 8x16" -letsp 8

What is that font? Where did you get it?

Online

#7 2024-04-10 19:56:17

cutecoder
Member
Registered: 2023-08-24
Posts: 10

Re: Problems with xterm, urxvt and tmux

I already tried that command but it looks awkward because characters are too far apart for 8 but the ends are slashed off for 4.

I got this font from: https://int10h.org/oldschool-pc-fonts/ and made a bunch of edits on it using fontforge.


They said get Archlinux, it'll be fun they said... ZOMG I LOVE ARCH

Offline

#8 2024-04-10 20:02:39

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

Which of them is your basis and does it show the same behavior?
rxvt-unicode-truecolor-wide-glyphs has negative linespacing

--- init.C.orig 2024-03-18 18:10:27.312570293 +0100
+++ init.C      2024-03-18 18:04:00.195303433 +0100
@@ -694,7 +694,7 @@ rxvt_term::init_resources (int argc, con
   if (rs[Rs_ext_bwidth] && (i = atoi (rs[Rs_ext_bwidth])) >= 0)
     ext_bwidth = min (i, std::numeric_limits<int16_t>::max ());
 
-  if (rs[Rs_lineSpace] && (i = atoi (rs[Rs_lineSpace])) >= 0)
+  if (rs[Rs_lineSpace] && (i = atoi (rs[Rs_lineSpace])) /*>= 0*/)
     lineSpace = min (i, std::numeric_limits<int16_t>::max ());
 
   if (const char *v = rs[Rs_letterSpace])

but you should focus on the fonts.

No problems w/ "xft:Noto Sans Mono:pixelsize=11" ?

Online

#9 2024-04-10 20:13:03

cutecoder
Member
Registered: 2023-08-24
Posts: 10

Re: Problems with xterm, urxvt and tmux

There is zero problem using "xft:Noto Sans Mono:pixelsize=11". I also downloaded the font package and the "original" font looks normal but some characters are slashed off at the beginning (seems like 1px) when using that font.


They said get Archlinux, it'll be fun they said... ZOMG I LOVE ARCH

Offline

#10 2024-04-10 20:25:23

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

https://int10h.org/oldschool-pc-fonts/f … m_vga_8x16 ?
What did you (attempt to) change about it?

Online

#11 2024-04-10 20:32:01

cutecoder
Member
Registered: 2023-08-24
Posts: 10

Re: Problems with xterm, urxvt and tmux

I implemented some characters and edited others. But even the original font does not work in urxvt.
I also just tried "xft:BmPlus IBM VGA 8x16:size=12" and that worked perfectly in xterm but not in urxvt (again 1px slashed off).


They said get Archlinux, it'll be fun they said... ZOMG I LOVE ARCH

Offline

#12 2024-04-10 20:39:35

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

What letters have a pixel slashed off?
The synthetically emboldened ones do here (you probably want to prevent that for bitmap fonts) but "-letsp 1" takes care of even that.

Online

#13 2024-04-10 20:45:47

cutecoder
Member
Registered: 2023-08-24
Posts: 10

Re: Problems with xterm, urxvt and tmux

Bold letters like s or a. However alacritty works fine and also xterm. Just this urxvt build or whatever does not work. The problem with "-letsp 1" is that the letters are too far away.


They said get Archlinux, it'll be fun they said... ZOMG I LOVE ARCH

Offline

#14 2024-04-10 21:02:11

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

◉ xterm -fa 'Bm437 IBM VGA 8x16'
xterm: Selected font has no non-zero height for ISO-8859-1 encoding

xterm requires you to specificy a size, eg.

xterm -fa 'Bm437 IBM VGA 8x16'

And even if I define a size for urxvt, it's gonna slash off pixels from emboldened characters (presumingly because it calculates the size from the actual glyphbox where the synthetically emboldened ones don't fit)
You're gonna die one way or another with that font.

The alternative (if you you walk up the link path) is to actually patch the vanilla urxvt for the tmux situation.
The one you're trying is obviously heavily patched wrt font rendering but it's ability to dynamically handle font metrics isn't exactly helping you with this specific font…

Online

#15 2024-04-11 15:07:49

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

There's a TTF variant, Bm437 IBM VGA 8x16 and a mixed one, Mx437 IBM VGA 8x16
The latter at

urxvt -fn 'xft:Mx437 IBM VGA 8x16:pixelsize=16'

should™ get you properly functioning pixel glyphs, better emboldening and support for italic glyphs?

Online

#16 2024-04-11 18:26:36

cutecoder
Member
Registered: 2023-08-24
Posts: 10

Re: Problems with xterm, urxvt and tmux

But then I would need to redo the bitmap glyphs in the TTF version which is quite some work. I can see how a TTF version can be advantageous especially because italic glyphs work but redoing all the glyphs (about 90) in TTF is tedious.


They said get Archlinux, it'll be fun they said... ZOMG I LOVE ARCH

Offline

#17 2024-04-12 10:02:23

seth
Member
Registered: 2012-09-03
Posts: 51,590

Re: Problems with xterm, urxvt and tmux

You could prevent the synthetic emboldening (it frankly doesn't look very nice) by using -fb along -fn for the same font.
Otherwise just don't use the wide-glyph patch.
(font:/boldFont: in the xrdb)

Online

Board footer

Powered by FluxBB