nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

the usage of nano-tiny, and a patch for 3.2


From: Benno Schulenberg
Subject: the usage of nano-tiny, and a patch for 3.2
Date: Fri, 24 Jan 2020 13:40:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Hello Jordi,

More than three years ago I included the word-jumping routines
(normally: Ctrl+Left/Ctrl+Right) also into the tiny version. [1]
But soon afterward I noticed that the Ctrl+Left/Right keystrokes
don't actually work when nano is built with Slang (--with-slang),
due to some bug in Slang. [2]

A few weeks ago, I found a different bug that occurs when nano is
built with Slang: the cursor is absent when nano is suspended. [3]
It was introduced with version 2.9.0, and no one noticed so far.

This made me wonder: how is the tiny nano used in Debian?  Is the
user free to start it in any way she likes?  Or is nano always
started from within another program (the installer)?  Without any
command-line options?  The latter would explain why nobody reported
the absence of the cursor when nano is suspended, because it will
not be possible to suspend such a nano.  Or... maybe no one ever
suspends the tiny nano?  If that is the case, then we might exclude
suspension from the tiny version and make it still a little smaller.

Anyway, this bug is fixed in git and you may want to apply the
attached patch to version 3.2 in Debian stable.

You may also wish to apply it to 4.5 in testing, or better: to 4.7.
Or you could wait until 4.8 comes out, in about two weeks.

[1] https://git.savannah.gnu.org/cgit/nano.git/commit/?id=08cd197b
[2] https://savannah.gnu.org/bugs/?49771
[3] https://savannah.gnu.org/bugs/?57517


Yesterday I found another bug that occurs when a nano built with Slang
has returned from suspension: ^C no longer works. [4]  This seems to
be a bug in Slang and thus unfixable.  It has been visible in nano
since version 2.2.0 from ten years ago.  This made me wonder: does
it really make sense to support Slang when it has so many bugs?

[4] https://savannah.gnu.org/bugs/?57656

To see how much a Debian install depends on Slang, I downloaded a
net install image:

  wget
https://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-netinst.iso
  sudo mount -t iso9660 ./debian-testing-amd64-netinst.iso /OTHER
  zcat /OTHER/install.amd/initrd.gz  |  cpio -i

Then I ran:

  ldd {usr/,}{s,}bin/* | grep -A4 -B2 slang

bin/nano:
        linux-vdso.so.1 (0x00007ffd6dd79000)
        libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 
(0x00007fa098118000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa097d27000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa097b23000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa097785000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fa0985fa000)

The only binary that is linked against Slang is nano!  Surely there must be
other stuff on that file system that links against Slang, but where is it?

  grep -r libslang * | grep Binary | grep -v slang

Binary file bin/nano matches
Binary file usr/lib/libnewt.so.0.52.21 matches
Binary file usr/lib/cdebconf/frontend/newt.so matches

Okay.  However, I cannot figure out how this newt stuff gets used by the
installer.  I'm guessing that .../frontend/newt.so itself gets executed.

Anyway, I looked at the size of libslang.  It's 1350K!

I've also downloaded the .deb files for a full nano, libncursesw, and
libtinfo.  After unpacking those files, I can run the contained nano:

  LD_LIBRARY_PATH=./lib/x86_64-linux-gnu/ bin/nano

So all that nano needs to run is libncursesw and libtinfo.  The first is
230K and the latter 184K in size.  However, libtinfo is already present
on the initrd (it is used by usr/bin/screen), so to get a nano that is
free from the bugs of Slang, all it needs is the 230K of libncursesw.
And possibly just libncurses (without UTF-8 support) is enough, which
would be just 160K.  Seeing that the initrd contains 2.5 MB for brltty,
surely a mere 160K can be added to get a fully functional nano?

Building the tiny nano against ncurses instead of Slang would mean that
it works better, but also that it gets much more testing, so that it is
unlikely to acquire bugs that go unnoticed for a long time.

Regards,

Benno

Attachment: 0001-display-show-the-cursor-during-suspension-also-when-.patch
Description: Text Data

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]