WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: overeager line wrapping in rxvt  (Read 2975 times)

Offline GNUser

  • Full Member
  • ***
  • Posts: 164
overeager line wrapping in rxvt
« on: September 17, 2019, 07:51:38 PM »
I'm on TC64 10.1 with default shell (BusyBox ash) and rxvt terminal emulator (for Unicode support).

When I use my default larger font, line wrap happens when text gets to edge of window as expected--then again (unexpectedly) once exactly 80 characters are reached. It looks awful and makes it difficult to edit the command.

Decreasing font size causes premature line wrap at 80 characters before edge of window is reached.

A picture is worth a thousand words:


So it seems there are two line wrap algorithms working simultaneously: A well-behaved one that wraps the line when text reaches edge of window, and a dimwitted one that wraps at exactly 80 characters. How do I keep the former and disable the latter? (Most of the information I'm finding pertains to bash shell and/or a more fancy terminal emulator, which is making it difficult to find relevant information.)

This is my ~/.Xdefaults when using my default (larger) font:
Code: [Select]
URxvt*scrollBar: true
URxvt*transparent: false
URxvt*title: Terminal
URxvt*foreground: white
URxvt*background: #300A24
URxvt*font: xft:Luxi Mono:pixelsize=14
URxvt*cursorColor: green
URxvt*fading: 30
URxvt*shading: 50
URxvt*color12: DodgerBlue1
URxvt*saveLines: 1000
fltk*scheme: gtk+
Xft.dpi: 96.0
« Last Edit: September 17, 2019, 07:59:16 PM by GNUser »

Offline andyj

  • Hero Member
  • *****
  • Posts: 754
Re: overeager line wrapping in rxvt
« Reply #1 on: September 17, 2019, 08:24:03 PM »
What desktop and video graphics are you using? What is your locale setting? There are a lot of variables here. I've seen a few glitches with rxvt regarding wrapping but not this one.

Offline jazzbiker

  • Full Member
  • ***
  • Posts: 132
Re: overeager line wrapping in rxvt
« Reply #2 on: September 17, 2019, 10:37:32 PM »
Hi, guys!
I'm having the same trick at TC10.0 x86. I use Xfbdev. The same extra line feed occures in aterm exactly in the same manner, so definitely it is ash issue.

Offline jazzbiker

  • Full Member
  • ***
  • Posts: 132
Re: overeager line wrapping in rxvt
« Reply #3 on: September 17, 2019, 10:42:55 PM »
For example such overfeed can occur if ash is not informed well about the actual screen width. So the first line feed is performed by terminal emulator, and the second by ash.

Offline jazzbiker

  • Full Member
  • ***
  • Posts: 132
Re: overeager line wrapping in rxvt
« Reply #4 on: September 17, 2019, 10:57:34 PM »
I've made some experiments and can conclude, that ash requests screen dimensions only at start. Working with initial --geometry XxY is ok. Narrowing causes double feeding, widening causes line feed not reaching screen border.
Code: [Select]
tc@box:~$ clearforces ash to acquire the screen dimensions.
« Last Edit: September 17, 2019, 11:02:57 PM by jazzbiker »

Offline jazzbiker

  • Full Member
  • ***
  • Posts: 132
Re: overeager line wrapping in rxvt
« Reply #5 on: September 17, 2019, 11:36:33 PM »
Sorry for overposting, but i was wrong about ash, it reads screen dimensions after every command line execution. Even Ctrl-C put elephants on their places.

Offline GNUser

  • Full Member
  • ***
  • Posts: 164
Re: overeager line wrapping in rxvt
« Reply #6 on: September 18, 2019, 05:36:54 AM »
@andyj: Fluxbox, Xorg and xf86-video-intel, en_US.UTF-8

FWIW my guess is that the two things butting heads in the top terminal in screenshot (with larger font I normally use) are:
linewrapper #1: readline (responsible for the first--appropriate--line wrap)
linewrapper #2: rxvt or possibly ash (responsible for the inappropriate line wrap after "-10.")

Interestingly, I cannot reproduce the problem in that top terminal 100% of the time. Most of the time it happens but sometimes it doesn't. Tab completion seems to make it happen more reliably but is not a guarantee.

From the bottom terminal you can see that if window is wide enough to fit 80 characters or more for your font size, only linewrapper #2 is in play. With only one linewrapper at play, there's no butting heads. It takes two to tango.

Therefore my workaround was to make the terminal at least 80 characters wide for my font size, then tell fluxbox to remember the window dimensions for rxvt.

If someone finds a proper solution rather than a workaround like mine--or if you know for sure who the two linewrappers are--please do share! :)
« Last Edit: September 18, 2019, 05:41:47 AM by GNUser »