Index | Thread | Search

From:
Walter Alejandro Iglesias <wai@roquesor.com>
Subject:
Re: bin/ksh: fix emacs/vi line editor getting wrong terminal width
To:
"Kirill A. Korinsky" <kirill@korins.ky>
Cc:
tech@openbsd.org
Date:
Wed, 21 Jan 2026 19:48:38 +0100

Download raw body.

Thread
On Wed, Jan 21, 2026 at 07:15:12PM +0100, Walter Alejandro Iglesias wrote:
> Ah!, I had not tried your other diff with UTF-8 characters.  Now I did
> and it appeared some garbage at the end before the '<' sign.
> 
> With your new diffs that issue is gone.
> 

I've just discovered a bug in ksh(1).  First I thought it was your diff,
but I could reproduce it also without your diff, in a slightly different
manner.  Apparently it's related to UTF-8 characters and resizing the
xterm window, this is why I'm mentioning this here (we'll see if it's
necessary or convenient to open a new bug report for this issue).

How to reproduce it:

  1.  Open a xterm with cwm(1) and write a line of UTF-8 characters.

  2.  Resize the window (with keybindings or with mouse, it's
      indifferent) to it's minimum width possible.

  3.  Resize the window back again to its original size.


Now, with your diff applied, ksh should've already core dumped.  Without
your diff it takes another one step, to press ENTER.  (In this case you
may need to repeat the action one or several times to reproduce the
crash).  This is the message I get:

  ksh(92612) in malloc(): write to free mem 0xcd38159b600[0..7]@96
  Abort trap (core dumped)


-- 
Walter